Image classification method, device and computer readable storage medium

By extracting and fusing the features of images and target objects, and utilizing dual feature extraction networks (visual semantics and saliency pathways) for image classification, the problem of low image classification accuracy in the existing technology is solved and higher classification accuracy is achieved. .

CN111783791BActive Publication Date: 2024-10-22BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010075143.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-01-22
Publication Date
2024-10-22
Estimated Expiration
2040-01-22

AI Technical Summary

Technical Problem

The accuracy of image classification in the existing technology is not high, and the overall information of the image cannot be effectively used for feature extraction and prediction.

Method used

By extracting the features of the image to be classified and the target object, and fusing them, a dual feature extraction network (visual semantic and visual saliency pathways) is used for classification, and the fused features are input into the classifier to improve classification accuracy.

Benefits of technology

The accuracy of image classification is improved, and the pertinence and accuracy of feature extraction are enhanced by simultaneously considering visual semantics and visual saliency information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111783791B_ABST
    Figure CN111783791B_ABST
Patent Text Reader

Abstract

The present invention discloses an image classification method, device and computer-readable storage medium, and relates to the field of image processing technology. The image classification method comprises: extracting a target object from an image to be classified; extracting features of the image to be classified and features of the target object, and fusing the extracted features; inputting the fused features into a classifier to obtain a classification result of the image to be classified. The present invention can extract and fuse the features of both the image to be classified and the target object, thereby using features that have both visual semantic information and visual saliency information for classification, thereby improving the accuracy of image classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image classification method, device and computer-readable storage medium. Background Art

[0002] The emergence of deep learning provides strong technical support for image classification, which continuously improves the accuracy of classification. Related technologies are based on the original pixel images for classification. Summary of the invention

[0003] After analysis, the inventors found that the original pixel image is based on the overall information of the image itself to extract features and predict features. However, the image classification results of the related art are not accurate.

[0004] A technical problem to be solved by the embodiments of the present invention is: how to improve the accuracy of image classification.

[0005] According to a first aspect of some embodiments of the present invention, there is provided an image classification method, comprising: extracting a target object from an image to be classified; extracting features of the image to be classified and features of the target object, and fusing the extracted features; inputting the fused features into a classifier to obtain a classification result for the image to be classified.

[0006] In some embodiments, extracting features of an image to be classified and features of a target object, and fusing the extracted features includes: using a first feature extraction network to extract features of the target object, the input features of each layer of the first feature extraction network are output features of the previous layer in the first feature extraction network; using a second feature extraction network to extract features of the image to be classified, the input features of each layer of the second feature extraction network include: the output features of the previous layer in the second feature extraction network, and the fusion result of the output features of the corresponding layer in the first feature extraction network.

[0007] In some embodiments, extracting features of the image to be classified and features of the target object and fusing the extracted features also includes: splicing or weighted summing the output features of the first feature extraction network and the features output by the second feature extraction network, so as to input the splicing result or the weighted summation result into the classifier.

[0008] In some embodiments, the input features of each layer of the second feature extraction network include: the sum of the output features of the previous layer in the second feature extraction network and the output features of the corresponding layer in the first feature extraction network.

[0009] In some embodiments, extracting the target object from the image to be classified includes: acquiring a saliency image of the image to be classified.

[0010] In some embodiments, obtaining the target object of the image to be classified includes: calculating the color distance and spatial distance between each image block and other blocks in the image to be classified; determining the degree of difference between two different image blocks in the image to be classified based on the color distance and the spatial distance; determining the salient blocks in the image to be classified based on the degree of difference; and constructing a saliency image of the image to be classified using the salient blocks.

[0011] In some embodiments, the image to be classified has multiple channels, and the saliency image has one channel.

[0012] In some embodiments, the image classification method also includes: obtaining a target object of a training image, the training image having a labeled classification result; using the training image and the target object of the training image to train an image classification model, the image classification model includes a feature extraction network and a classifier, the feature extraction network is used to extract features of the training image and features of the target object of the training image, and fuse the extracted features.

[0013] According to a second aspect of some embodiments of the present invention, there is provided an image classification device, comprising: a target object extraction module, configured to extract a target object from an image to be classified; a feature fusion module, configured to extract features of the image to be classified and features of the target object, and to fuse the extracted features; and a classification module, configured to input the fused features into a classifier to obtain a classification result for the image to be classified.

[0014] According to a third aspect of some embodiments of the present invention, there is provided an image classification apparatus, comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to execute any one of the aforementioned image classification methods based on instructions stored in the memory.

[0015] According to a fourth aspect of some embodiments of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements any one of the aforementioned image classification methods.

[0016] Some embodiments of the above invention have the following advantages or beneficial effects: the present invention can extract and fuse the features of the image to be classified and the target object, thereby using features that have both visual semantic information and visual saliency information for classification, thereby improving the accuracy of image classification.

[0017] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0019] Figure 1 A schematic flow chart of an image classification method according to some embodiments of the present invention is shown.

[0020] Figure 2 The structural schematic diagram of the first feature extraction network and the second feature extraction network is exemplarily shown.

[0021] Figure 3 A schematic flow chart of an image classification model training method according to some embodiments of the present invention is shown.

[0022] Figure 4 The structure of the image classification model is shown exemplarily.

[0023] Figure 5 A schematic structural diagram of an image classification device according to some embodiments of the present invention is shown.

[0024] Figure 6 A schematic structural diagram of an image classification device according to some other embodiments of the present invention is shown.

[0025] Figure 7 A schematic structural diagram of an image classification device according to some further embodiments of the present invention is shown. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present invention and its application or use. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] The relative arrangement of components and steps, the numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.

[0028] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.

[0029] Technologies, methods, and apparatus known to ordinary technicians in the relevant field may not be discussed in detail, but where appropriate, such technologies, methods, and apparatus should be considered part of the authorization specification.

[0030] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0031] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0032] After further analysis, the inventor found that from a physiological perspective, some scholars have proposed that there are two visual perception areas in the cerebral cortex. The one related to visual semantics is called the "What" pathway, which mainly resolves the visual semantic information of objects; the one related to the location information of objects is called the "Where" pathway, which mainly resolves the visual saliency information of objects. The present invention takes both types of information into consideration when classifying images to obtain better classification results. Figure 1 An embodiment of the image classification method of the present invention is described.

[0033] Figure 1 FIG. 4 is a flow chart showing an image classification method according to some embodiments of the present invention. Figure 1 As shown, the image classification method of this embodiment includes steps S102 to S106.

[0034] In step S102, a target object is extracted from the image to be classified.

[0035] The target object is the object of interest to human vision in the image to be classified.

[0036] In some embodiments, the target object can be extracted by acquiring a saliency image of the image to be classified. A saliency image refers to an image acquired by visual saliency detection. Visual saliency detection simulates human visual characteristics through an algorithm to extract salient areas in an image, i.e., areas of human visual interest. Visual saliency detection algorithms include LC algorithms based on pixel global contrast, HC algorithms based on color information, FT algorithms using color features and brightness features, and AC algorithms based on neighborhood calculations, etc.

[0037] In some embodiments, the color distance and spatial distance between each image block and other blocks in the image to be classified are calculated; the degree of difference between two different image blocks in the image to be classified is determined based on the color distance and the spatial distance; the significant blocks in the image to be classified are determined based on the degree of difference; and the significant image of the image to be classified is constructed using the significant blocks. When calculating the color distance, the color can be mapped to a point in the color space, and the distance between the points in the color space is calculated. The spatial distance refers to the distance between the positions of different image blocks in the image. Thus, the color blocks that are more prominent in color and space can be extracted to generate a significant image.

[0038] As needed, those skilled in the art may also adopt other methods to obtain the target object, such as adopting a target detection method, etc., which will not be described in detail here.

[0039] In step S104, features of the image to be classified and features of the target object are extracted, and the extracted features are fused.

[0040] In some embodiments, a feature extraction network may be used to extract features of the image to be classified and the target object respectively and then fuse them, or feature fusion may be performed during the feature extraction process.

[0041] Therefore, the fused features contain both visual semantic information and visual saliency information.

[0042] In step S106, the fused features are input into a classifier to obtain a classification result of the image to be classified. The classification result may be, for example, an image of the sea, an image of a plant, an image of a building, an image of an animal, and the like.

[0043] Through the method of the above embodiment, the present invention can extract and fuse the features of the image to be classified and the target object, so as to use the features having both visual semantic information and visual saliency information for classification, thereby improving the accuracy of image classification.

[0044] In some embodiments, the image to be classified and the target object classification can be input into two feature extraction networks. The first feature extraction network is used to extract the features of the target object, wherein the input features of each layer of the first feature extraction network are the output features of the previous layer in the first feature extraction network; the second feature extraction network is used to extract the features of the image to be classified, wherein the input features of each layer of the second feature extraction network include: the output features of the previous layer in the second feature extraction network, and the fusion result of the output features of the corresponding layer in the first feature extraction network.

[0045] In some embodiments, the first layer of the first feature extraction network receives data of the target object, such as a saliency image, and the first layer of the second feature extraction network receives data of an image to be classified.

[0046] Through the above embodiment, the first feature extraction network extracts the features of the target object itself; the second feature extraction network continuously refers to the intermediate features of the target object in the process of extracting information of the image to be classified, so that the visual semantic information extracted from the image to be classified is more targeted. This method of continuously performing fusion processing during the extraction process can better fuse the features of the image to be classified and the target object.

[0047] In some embodiments, the input features of each layer of the second feature extraction network include: the sum of the output features of the previous layer in the second feature extraction network and the output features of the corresponding layer in the first feature extraction network. In this case, the corresponding layers of the first feature extraction network and the second feature extraction network have the same number of nodes, so that the output results of the two layers can be directly added. As needed, in addition to addition, the technology in the field can also adopt other methods, such as weighted summation, vector concatenation, etc., which will not be repeated here.

[0048] Figure 2 The schematic diagram of the structure of the first feature extraction network and the second feature extraction network is exemplarily shown. Figure 2 As shown, the mth layer of the first feature extraction network receives the input of the m-1th layer, the m+1th layer receives the input of the mth layer, and so on; the nth layer of the second feature extraction network receives the input of the n-1th layer of the second feature extraction network and the m-1th layer of the first feature extraction network, the n+1th layer receives the input of the nth layer of the second feature extraction network and the mth layer of the first feature extraction network, and so on. m and n can be set to the same value or different values, that is, the second feature extraction network can perform feature fusion layer by layer or use partial layers for fusion.

[0049] In some embodiments, the output features of the first feature extraction network and the features output by the second feature extraction network are concatenated or weighted summed, so that the concatenation result or the weighted summation result is input into the classifier. For example, the network for extracting features includes the first feature extraction network, the second feature extraction network and a feature extraction layer, and the feature extraction layer is used to further fuse the output results of the first feature extraction network and the second feature extraction network. Thus, the final fusion process can be intuitively performed.

[0050] Since the output result of the second feature extraction network also has the features extracted from the image to be classified, those skilled in the art may also directly input the output result of the second feature extraction network into the classifier as needed.

[0051] The first feature extraction network and the second feature extraction network can adopt the structure of Alexnet, Vggnet, Caffenet, Resnet and other networks.

[0052] Reference below Figure 3 An embodiment of the image classification model training method of the present invention is described.

[0053] Figure 3 FIG. 2 is a flow chart showing a method for training an image classification model according to some embodiments of the present invention. Figure 3 As shown, the image classification model training method of this embodiment includes steps S302 to S304.

[0054] In step S302, a target object of a training image is obtained, wherein the training image has a labeled classification result.

[0055] In step S304, the image classification model is trained using the training images and the target objects of the training images.

[0056] The image classification model includes a feature extraction network and a classifier. The feature extraction network is used to extract the features of the training image and the features of the target object in the training image, and fuse the extracted features. An exemplary structure of the image classification model is as follows Figure 4 shown.

[0057] exist Figure 4 In the algorithm, the target object is input into the first feature extraction network to form a visual saliency pathway; the image to be classified is input into the second feature extraction network to form a visual semantic pathway. The output results of the first and second feature extraction networks are input into the feature fusion layer for further fusion. The first feature extraction network, the second feature extraction network and the feature fusion layer together form a feature extraction network. The output results of the feature extraction network are input into the classifier. Figure 4 This dual-pathway deep learning neural network structure, assisted by visual saliency provided by the target object, can achieve feature fusion of the image to be classified and the target object.

[0058] Then, the trained image classification model can be used to obtain the classification result of the image.

[0059] Through the method of the above embodiment, the feature extraction network and the classifier can be trained together using labeled data, thereby improving the accuracy of image classification.

[0060] Reference below Figure 5 An embodiment of the image classification device of the present invention is described.

[0061] Figure 5 FIG. 4 is a schematic diagram showing the structure of an image classification device according to some embodiments of the present invention. Figure 5As shown, the image classification device 50 of this embodiment includes: a target object extraction module 510, configured to extract the target object from the image to be classified; a feature fusion module 520, configured to extract the features of the image to be classified and the features of the target object, and fuse the extracted features; a classification module 530, configured to input the fused features into a classifier to obtain a classification result for the image to be classified.

[0062] In some embodiments, the feature fusion module 520 is further configured to use a first feature extraction network to extract features of the target object, and the input features of each layer of the first feature extraction network are the output features of the previous layer in the first feature extraction network; and use a second feature extraction network to extract features of the image to be classified, and the input features of each layer of the second feature extraction network include: the output features of the previous layer in the second feature extraction network, and the fusion result of the output features of the corresponding layer in the first feature extraction network.

[0063] In some embodiments, the feature fusion module 520 is further configured to concatenate or weighted sum the output features of the first feature extraction network and the features output by the second feature extraction network, so as to input the concatenation result or the weighted summation result into the classifier.

[0064] In some embodiments, the input features of each layer of the second feature extraction network include: the sum of the output features of the previous layer in the second feature extraction network and the output features of the corresponding layer in the first feature extraction network.

[0065] In some embodiments, the target object extraction module 510 is further configured to obtain a saliency image of the image to be classified.

[0066] In some embodiments, the target object extraction module 510 is further configured to calculate the color distance and spatial distance between each image block and other blocks in the image to be classified; determine the degree of difference between two different image blocks in the image to be classified based on the color distance and spatial distance; determine the salient blocks in the image to be classified based on the degree of difference; and use the salient blocks to construct a saliency image of the image to be classified.

[0067] In some embodiments, the image to be classified has multiple channels, and the saliency image has one channel.

[0068] In some embodiments, the image classification device 50 also includes: a training module 540, which is configured to obtain a target object of a training image, and the training image has a labeled classification result; the image classification model is trained using the training image and the target object of the training image, and the image classification model includes a feature extraction network and a classifier, and the feature extraction network is used to extract features of the training image and features of the target object of the training image, and fuse the extracted features.

[0069] Figure 6 FIG. 4 shows a schematic diagram of the structure of an image classification device according to some other embodiments of the present invention. Figure 6 As shown, the image classification device 60 of this embodiment includes: a memory 610 and a processor 620 coupled to the memory 610 , and the processor 620 is configured to execute the image classification method in any one of the aforementioned embodiments based on the instructions stored in the memory 610 .

[0070] The memory 610 may include, for example, a system memory, a fixed non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader, and other programs.

[0071] Figure 7 FIG. 4 shows a schematic diagram of the structure of an image classification device according to some other embodiments of the present invention. Figure 7 As shown, the image classification device 70 of this embodiment includes: a memory 710 and a processor 720, and may also include an input / output interface 730, a network interface 740, a storage interface 750, etc. These interfaces 730, 740, 750 and the memory 710 and the processor 720 may be connected, for example, via a bus 760. Among them, the input / output interface 730 provides a connection interface for input / output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 740 provides a connection interface for various networked devices. The storage interface 750 provides a connection interface for external storage devices such as SD cards and USB flash drives.

[0072] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein the program implements any one of the aforementioned image classification methods when executed by a processor.

[0073] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable non-transient storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0074] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0075] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0076] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0077] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. An image classification method, comprising: Extracting a target object from an image to be classified, comprising: calculating the color distance and spatial distance between each image block and other blocks in the image to be classified; determining the degree of difference between two different image blocks in the image to be classified according to the color distance and spatial distance; determining a significant block in the image to be classified according to the degree of difference; and constructing a significant image of the image to be classified using the significant block; wherein, by mapping colors to points in a color space, the distance between the points in the color space is taken as the color distance; the spatial distance refers to the distance between the positions of different image blocks in the image; Extracting features of the image to be classified and features of the target object, and fusing the extracted features, including: using a first feature extraction network to extract features of the target object, wherein the first layer of the first feature extraction network receives the saliency image, and the input features of each layer of the first feature extraction network are output features of the previous layer in the first feature extraction network; using a second feature extraction network to extract features of the image to be classified, wherein the first layer of the second feature extraction network receives the image to be classified, and the input features of each layer of the second feature extraction network include: the output features of the previous layer in the second feature extraction network, and the fusion result of the output features of the corresponding layer in the first feature extraction network; The fused features are input into the classifier to obtain the classification result of the image to be classified.

2. The image classification method according to claim 1, wherein: The extracting the features of the image to be classified and the features of the target object and fusing the extracted features further comprises: The output features of the first feature extraction network and the features output by the second feature extraction network are concatenated or weighted summed, so that the concatenation result or the weighted summation result is input into the classifier.

3. The image classification method according to claim 1, wherein: The input features of each layer of the second feature extraction network include: the sum of the output features of the previous layer in the second feature extraction network and the output features of the corresponding layer in the first feature extraction network.

4. The image classification method according to claim 1, wherein: The image to be classified has multiple channels, and the saliency image has one channel.

5. The image classification method according to any one of claims 1 to 4, further comprising: Acquire a target object of a training image, wherein the training image has a labeled classification result; The image classification model is trained using the training image and the target object of the training image, wherein the image classification model includes a feature extraction network and a classifier, the feature extraction network is used to extract features of the training image and the target object of the training image, and fuse the extracted features.

6. An image classification device, comprising: The target object extraction module is configured to extract the target object from the image to be classified, including: calculating the color distance and spatial distance between each image block and other blocks in the image to be classified; determining the difference between two different image blocks in the image to be classified according to the color distance and spatial distance; determining the significant blocks in the image to be classified according to the difference; using the significant blocks to construct a saliency image of the image to be classified; wherein, by mapping colors to points in a color space, the distance between the points in the color space is used as the color distance; the spatial distance refers to the distance between the positions of different image blocks in the image; A feature fusion module is configured to extract features of the image to be classified and features of the target object, and fuse the extracted features, including: using a first feature extraction network to extract features of the target object, wherein the first layer of the first feature extraction network receives the saliency image, and the input features of each layer of the first feature extraction network are output features of a previous layer in the first feature extraction network; using a second feature extraction network to extract features of the image to be classified, wherein the first layer of the second feature extraction network receives the image to be classified, and the input features of each layer of the second feature extraction network include: the output features of a previous layer in the second feature extraction network, and the fusion result of the output features of the corresponding layer in the first feature extraction network; The classification module is configured to input the fused features into the classifier to obtain a classification result for the image to be classified.

7. An image classification device, comprising: Memory; as well as A processor coupled to the memory, wherein the processor is configured to execute the image classification method according to any one of claims 1 to 5 based on instructions stored in the memory.

8. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the image classification method according to any one of claims 1 to 5 is implemented.