Image feature extraction method and device, electronic equipment and storage medium

By performing pooling and correction operations during image feature extraction, the problem of low image feature extraction accuracy in existing technologies is solved, and the accuracy of image classification is improved.

CN115700785BActive Publication Date: 2026-04-10SF TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-16
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing image feature extraction methods have low feature extraction accuracy, resulting in low image classification accuracy, especially for images where the feature differences between categories are not obvious.

Method used

By performing pooling on the pixel matrix after convolution and correcting each pixel in the pooled pixel matrix using a preset correction function, the corrected pixel matrix is ​​obtained, thereby determining the target image features of the target image.

Benefits of technology

It improves the accuracy of image feature extraction and enhances the accuracy of image classification, especially for images where the feature differences between categories are not obvious.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115700785B_ABST
    Figure CN115700785B_ABST
Patent Text Reader

Abstract

The application provides an image feature extraction method and device, electronic equipment and computer readable storage medium. The image feature extraction method comprises: performing convolution operation on a target image to be subjected to feature extraction to obtain a pixel matrix M*N of the target image; performing pooling operation on the pixel matrix M*N to obtain a pixel matrix m*n; correcting each pixel point in the pixel matrix m*n based on a preset correction function and the pixel matrix M*N to obtain a corrected pixel matrix; and determining a target image feature of the target image based on the corrected pixel matrix, wherein the target image feature is used for classifying the target image. In the application, the target image feature of the target image is determined based on the corrected pixel matrix, which can improve the accuracy of image feature extraction. Even for images with indistinct features between categories, the accuracy of image feature extraction can be improved, thereby improving the accuracy of image classification.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer vision, in particular to an image feature extraction method and device, electronic equipment and computer readable storage medium. BACKGROUND

[0002] With the rapid development of computer vision technology, the application of computer vision technology is becoming more and more widely used. Image is a common processing task in computer vision technology. For example, in the logistics field, trucks and air freight boxes in the loading and unloading site can be classified through image classification.

[0003] Among them, image feature extraction is an important step in image classification. In deep learning, image feature extraction is usually performed by convolution through the convolution layer in the network structure and pooling through the pooling layer, and finally the extracted image features are obtained.

[0004] However, the present inventors have found in practical application that for some images with insignificant feature differences between categories, the classification accuracy is relatively low when the image features are extracted by the conventional image feature extraction method for image classification. It can be seen that the feature extraction accuracy of the existing image feature extraction method is relatively low, which further leads to the problem of low image classification accuracy. SUMMARY

[0005] The present application provides an image feature extraction method, device, electronic equipment and computer readable storage medium, which aims to solve the problem of low image classification accuracy caused by the relatively low feature extraction accuracy of the existing image feature extraction method.

[0006] In a first aspect, the present application provides an image feature extraction method, which comprises:

[0007] performing a convolution operation on a target image to be extracted to obtain a pixel matrix M*N of the target image;

[0008] performing a pooling operation on the pixel matrix M*N to obtain a pixel matrix m*n;

[0009] correcting each pixel point in the pixel matrix m*n based on a preset correction function and the pixel matrix M*N to obtain a corrected pixel matrix;

[0010] determining a target image feature of the target image based on the corrected pixel matrix, wherein the target image feature is used for classifying the target image.

[0011] In a second aspect, the present application provides an image feature extraction device, which comprises:

[0012] a convolution unit, configured to perform a convolution operation on a target image to be subjected to feature extraction, to obtain a pixel matrix M*N of the target image;

[0013] a pooling unit, configured to perform a pooling operation on the pixel matrix M*N, to obtain a pixel matrix m*n;

[0014] a correction unit, configured to correct each pixel in the pixel matrix m*n based on a preset correction function and the pixel matrix M*N, to obtain a corrected pixel matrix;

[0015] a determination unit, configured to determine a target image feature of the target image based on the corrected pixel matrix, wherein the target image feature is used for classifying the target image.

[0016] In some embodiments, the correction unit is specifically configured to:

[0017] traverse each pixel in the pixel matrix m*n, and obtain a target pixel corresponding to a current traversal pixel position from the pixel matrix M*N;

[0018] determine a correction parameter of the current traversal pixel according to the target pixel and the current traversal pixel;

[0019] determine a correction value of the current traversal pixel based on the correction parameter and a preset correction function, until the correction values of all pixels in the pixel matrix m*n are obtained;

[0020] determine the corrected pixel matrix based on the correction values of all pixels in the pixel matrix m*n.

[0021] In some embodiments, the correction unit is specifically configured to:

[0022] obtain a difference between a pixel value of the current traversal pixel and a pixel value of the target pixel as the correction parameter of the current traversal pixel.

[0023] In some embodiments, the correction unit is specifically configured to:

[0024] obtain a function value of the preset correction function based on the correction parameter;

[0025] when the correction parameter is greater than a preset threshold, obtain a difference between the correction parameter and the function value as the correction value of the current traversal pixel;

[0026] when the correction parameter is less than the preset threshold, obtain a sum of the correction parameter and the function value as the correction value of the current traversal pixel;

[0027] Until the traversal of each pixel in the pixel matrix m*n is completed, the correction value of each pixel in the pixel matrix m*n is obtained.

[0028] In some embodiments, the correction unit is specifically configured to:

[0029] Obtain a pixel position mapping relationship between the pixel matrix m*n and the pixel matrix M*N;

[0030] Traverse each pixel in the pixel matrix m*n, and based on the pixel position mapping relationship and the position of the current traversed pixel, obtain a target pixel corresponding to the current traversed pixel position from the pixel matrix M*N.

[0031] In some embodiments, the correction unit is specifically configured to:

[0032] Obtain a first center pixel of the pixel matrix M*N as a first orthographic projection position of a second center pixel of the pixel matrix m*n on the pixel matrix M*N;

[0033] Based on the top-left pixel of the pixel matrix M*N, the width and height of the pixel matrix M*N, and the width and height of the pixel matrix m*n, determine a second orthographic projection position of the top-left pixel in the pixel matrix m*n on the pixel matrix M*N;

[0034] Based on the first orthographic projection position and the second orthographic projection position, determine the pixel position mapping relationship.

[0035] In some embodiments, the preset correction function is one of f(X)=k1*X+b1, f(X)=sigmoid(X), f(X)=k2*Xa+b2, and f(X)=exp-loss(X), where X represents a correction parameter, k1 and k2 are weight coefficients, a, b1, and b2 are constants, and 0

[0036] In some embodiments, the pooling unit is specifically configured to:

[0037] Perform a max-pooling operation on the pixel matrix M*N to obtain the pixel matrix m*n;

[0038] Or, perform an average-pooling operation on the pixel matrix M*N to obtain the pixel matrix m*n.

[0039] In some embodiments, the convolution unit is specifically configured to:

[0040] Perform a convolution operation on the target image through a feature extraction layer in a to-be-trained image classification model to obtain a pixel matrix M*N of the target image;

[0041] In some embodiments, the pooling unit is specifically configured to:

[0042] perform a pooling operation on the pixel matrix M*N to obtain a pixel matrix m*n;

[0043] In some embodiments, the image feature extraction apparatus further comprises a training unit, which is specifically configured to:

[0044] determine a sample image feature of the target image based on the pixel matrix m*n;

[0045] determine a feature extraction loss of the image classification model to be trained according to the sample image feature and the target image feature;

[0046] adjust model parameters of the feature extraction layer based on the feature extraction loss, until a preset first stop training condition is reached, to obtain a trained image classification model.

[0047] In some embodiments, the target image is labeled with a class label, and the training unit is specifically configured to:

[0048] perform prediction according to the target image feature through a prediction layer in the image classification model to be trained, to obtain a predicted class of the target image;

[0049] determine a classification loss of the image classification model to be trained according to the predicted class and an actual class corresponding to the class label;

[0050] adjust model parameters of the prediction layer based on the classification loss, until a preset second stop training condition is reached, to obtain a trained image classification model.

[0051] In a third aspect, the present application also provides an electronic device, which comprises a processor and a memory, wherein the memory stores a computer program, and the processor invokes the computer program in the memory to perform the steps in any of the image feature extraction methods provided by the present application.

[0052] In a fourth aspect, the present application also provides a computer readable storage medium, which stores a computer program, and the computer program is loaded by a processor to perform the steps in the image feature extraction method.

[0053] This application improves the accuracy of image feature extraction by performing a pooling operation during image feature extraction. After obtaining a pixel matrix m*n through conventional pooling, the pixel matrix m*n is corrected based on a preset correction function and the pixel matrix M*n. The target image features are then determined based on the corrected pixel matrix. This improves the accuracy of image feature extraction to a certain extent, thus avoiding the problem of low image classification accuracy caused by the relatively low feature extraction accuracy of existing image feature extraction methods. Attached Figure Description

[0054] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0055] Figure 1 This is a schematic diagram of a scene of the image feature extraction system provided in the embodiments of this application;

[0056] Figure 2 This is a schematic flowchart of an image feature extraction method provided in an embodiment of this application;

[0057] Figure 3 This is an illustrative diagram illustrating a target pixel corresponding to the currently traversed pixel position, provided in an embodiment of this application.

[0058] Figure 4 This is an illustrative diagram illustrating the correction operation under multiple pooling layers provided in the embodiments of this application;

[0059] Figure 5 This is another illustrative diagram illustrating the correction operation under multiple pooling layers provided in the embodiments of this application;

[0060] Figure 6 This is a schematic diagram of a network architecture for an image classification model provided in the embodiments of this application;

[0061] Figure 7 This is a schematic diagram of an embodiment of the image feature extraction device provided in the application;

[0062] Figure 8 This is a schematic diagram of an embodiment of the electronic device provided in this application. Detailed Implementation

[0063] With reference to the drawings and the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0064] In the description of the embodiments of the present application, it should be understood that the terms "first", "second" are used only for the purpose of description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise explicitly and specifically limited.

[0065] The following description is given in order to enable any person skilled in the art to practice and use the present application. In the following description, details are set forth in order to explain the application. It will be apparent to a person skilled in the art that the application can be practiced without using these specific details. In other instances, well-known processes have not been described in detail in order to avoid unnecessarily obscuring the description of the embodiments of the present application. Therefore, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.

[0066] The execution subject of the image feature extraction method in the embodiments of the present application can be an image feature extraction device provided by the embodiments of the present application, or a server device, a physical host or a user equipment (User Equipment, UE) and other different types of electronic devices integrated with the image feature extraction device. The image feature extraction device can be realized in hardware or software, and the UE can be a terminal device such as a smart phone, a tablet computer, a notebook computer, a palm computer, a desktop computer or a personal digital assistant (Personal Digital Assistant, PDA).

[0067] The electronic device can run in a separate mode, or can run in a device cluster mode.

[0068] Referring to Figure 1 , Figure 1is a scene schematic diagram of an image feature extraction system provided by an embodiment of the present application. The image feature extraction system can include an electronic device 100, and the electronic device 100 is integrated with an image feature extraction apparatus. For example, the electronic device can perform a convolution operation on a target image to be subjected to feature extraction, to obtain a pixel matrix M*N of the target image; perform a pooling operation on the pixel matrix M*N, to obtain a pixel matrix m*n; perform correction on each pixel point in the pixel matrix m*n based on a preset correction function and the pixel matrix M*N, to obtain a corrected pixel matrix; and determine a target image feature of the target image based on the corrected pixel matrix, wherein the target image feature is used for classifying the target image.

[0069] In addition, as shown in Figure 1 The image feature extraction system can further include a memory 200 for storing data, such as storing image data and video data.

[0070] It should be noted that Figure 1 The scene schematic diagram of the image feature extraction system shown is only an example, and the image feature extraction system and the scene described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, as the image feature extraction system evolves and new business scenarios appear, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

[0071] Next, the image feature extraction method provided by the embodiments of the present application will be introduced. In the embodiments of the present application, an electronic device is taken as an execution subject, and in subsequent method embodiments, the execution subject will be omitted for the sake of simplification and convenience of description. The image feature extraction method includes: performing a convolution operation on a target image to be subjected to feature extraction, to obtain a pixel matrix M*N of the target image; performing a pooling operation on the pixel matrix M*N, to obtain a pixel matrix m*n; performing correction on each pixel point in the pixel matrix m*n based on a preset correction function and the pixel matrix M*N, to obtain a corrected pixel matrix; and determining a target image feature of the target image based on the corrected pixel matrix, wherein the target image feature is used for classifying the target image.

[0072] Referring to Figure 2 , Figure 2 is a flowchart of an image feature extraction method provided by an embodiment of the present application. It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described can be performed in an order different from that shown here. The image feature extraction method includes steps 201-204, wherein:

[0073] 201, performing a convolution operation on a target image to be extracted, to obtain a pixel matrix M*N of the target image.

[0074] The target image is an image to be classified. With different business scenarios, the target image can be an image to be classified in different business scenarios. For example, the target image can be an image of a loading and unloading site in the logistics field. For another example, the target image can also be an image of an airport security check machine.

[0075] The pixel matrix M*N is a pixel matrix obtained after performing a convolution operation on the target image. M*N represents the size of the pixel matrix, where M represents the width of the pixel matrix M*N, and N represents the height of the pixel matrix M*N.

[0076] The target image can be an RGB image, in which case the target image includes three channels (R, G, B), and the input of each channel is a pixel matrix of the same size. However, for ease of understanding, the image feature extraction method in the embodiments of the present application is described by taking a target image as a single-channel pixel matrix. In the embodiments of the present application, in order to facilitate data processing, the target image is expressed in the form of a pixel matrix, for example, the target image is expressed as a pixel matrix of 227*227*3, where 3 represents three channels (R, G, B), and 227*227 is the height and width of a single channel.

[0077] In step 201, a convolution operation is performed on the target image to be extracted according to a preset stride, a preset kernel size, to obtain a pixel matrix M*N of the target image. The convolution operation on the target image can be performed by using some existing convolution network. For example, the convolution operation on the target image can be performed by using the convolution layer in the AlexNet network structure.

[0078] For example, it is assumed that a convolution operation is performed on an image of 227*227*3. Here, a convolution operation is performed on a single channel by using the convolution layer in the classic AlexNet network structure. If the preset stride is stride=4, the preset padding is pad=0, and the preset kernel size is 11*11. After the convolution operation is performed by using the AlexNet network structure, a pixel matrix M*N of 55*55 pixels is output, where M=N (227-11+2*0) / 4+1=55.

[0079] 202, performing a pooling operation on the pixel matrix M*N to obtain a pixel matrix m*n.

[0080] There are various ways to perform the pooling operation in step 202, exemplarily including:

[0081] (1) performing a max-pooling operation on the pixel matrix M*N to obtain a pixel matrix m*n.

[0082] (2) performing an average pooling operation on the pixel matrix M*N to obtain a pixel matrix m*n.

[0083] 203. correcting each pixel in the pixel matrix m*n based on a preset correction function and the pixel matrix M*N to obtain a corrected pixel matrix.

[0084] In order to facilitate understanding, the processing step of step 202 in the image feature extraction process in the embodiments of the present application is referred to as "pooling operation", and the processing step of step 203 is referred to as "correction operation". In fact, steps 202 and 203 can be regarded as a "pooling process" in the entire image feature extraction process.

[0085] In the embodiments of the present application, the correction operation is mainly to correct each pixel value in the pixel matrix after the pooling operation.

[0086] In some embodiments, the entire image feature extraction process can only pass through one pooling operation. In other embodiments, the entire image feature extraction process can also pass through multiple pooling operations.

[0087] The "pooling process" in the embodiments of the present application will be described below with respect to the case that the entire image feature extraction process only passes through one pooling operation and the case that the entire image feature extraction process passes through multiple pooling operations.

[0088] (I) The entire image feature extraction process only passes through one pooling operation.

[0089] Since the entire image feature extraction process only passes through one pooling operation, only one correction operation is needed. At this time, step 203 can specifically include steps 2031-2034 as follows:

[0090] 2031. Traversing each pixel in the pixel matrix m*n, obtaining a target pixel corresponding to the current traversal pixel position from the pixel matrix M*N.

[0091] The target pixel refers to a pixel in the pixel matrix M*N that has a pixel position mapping relationship with the current traversal pixel.

[0092] The target pixel and the current traversal pixel can be represented by coordinates. The coordinates (such as (x, y)) of the current traversal pixel represent the position of the current traversal pixel in the pixel matrix m*n, and the coordinates (such as (x', y')) of the target pixel represent the position of the target pixel in the pixel matrix M*N.

[0093] Exemplarily, step 2031 can specifically include steps a1-a2:

[0094] a1, obtain a pixel position mapping relationship between the pixel matrix m*n and the pixel matrix M*N.

[0095] The pixel position mapping relationship refers to a pixel position mapping relationship between the pixel matrix m*n and the pixel matrix M*N.

[0096] The pixel position mapping relationship refers to a pixel position mapping relationship between the pixel matrix m*n and the pixel matrix M*N.

[0097] (1) The preset database already has a preset pixel position mapping relationship, and the preset pixel position mapping relationship is directly obtained from the preset database.

[0098] (2) Real-time determination of the pixel position mapping relationship. For ease of understanding, please refer to Figure 3 , Figure 3 is a schematic diagram provided by an embodiment of the present application to illustrate a target pixel corresponding to a current traversal pixel position. At this time, step a1 can specifically include:

[0099] a11, obtain a first center pixel of the pixel matrix M*N as a first orthographic projection position of a second center pixel of the pixel matrix m*n on the pixel matrix M*N.

[0100] The first center pixel refers to a pixel at a coordinate (M / 2, N / 2) in the pixel matrix M*N.

[0101] The second center pixel refers to a pixel at a coordinate (m / 2, n / 2) in the pixel matrix m*n.

[0102] a12, based on a top-left pixel of the pixel matrix M*N, a width and a height of the pixel matrix M*N, and a width and a height of the pixel matrix m*n, determine a second orthographic projection position of the top-left pixel in the pixel matrix m*n on the pixel matrix M*N.

[0103] The width and height of the pixel matrix M*N are M and N respectively, and the width and height of the pixel matrix m*n are m and n respectively.

[0104] The top-left pixel of the pixel matrix M*N refers to a pixel at a coordinate (0, 0) in the pixel matrix M*N.

[0105] The top-left pixel in the pixel matrix m*n refers to a pixel at a coordinate (0, 0) in the pixel matrix m*n.

[0106] For ease of understanding, please refer to Figure 3 , for example Figure 3As shown, exemplarily, the second orthographic projection position (x', y') = ((0 + (M - m) / 2), (0 + (N - n) / 2)) = (((M - m) / 2), ((N - n) / 2)). Figure 3 In the figure, the solid line represents the pixel matrix M*N, and the dashed line represents the pixel matrix m*n. The pixel matrix M*N is a 4*4 pixel matrix, and the pixel matrix m*n is a 2*2 pixel matrix.

[0107] a13, determining the pixel position mapping relationship based on the first orthographic projection position and the second orthographic projection position.

[0108] In some embodiments, the pixel position mapping relationship can be a function of the current traversal pixel with respect to the target pixel in the pixel matrix M*N. For example, (x', y') = (f(x), f(y)), where (x, y) is the coordinate of the current traversal pixel, and (x', y') is the coordinate of the target pixel in the pixel matrix M*N. At this time, the first orthographic projection position (M / 2, N / 2), the second center pixel (m / 2, n / 2), the second orthographic projection position (((M-m) / 2),((N-n) / 2)), and the top-left pixel (0, 0) in the pixel matrix m*n can be substituted into the preset function (such as x' = f(x) = a1*x + b1, y' = f(y) = a2*y + b2) to calculate, and the specific values of a1, a2, b1, and b2 can be obtained. Thus, the function (x', y') = (f(x), f(y)) of the current traversal pixel with respect to the target pixel in the pixel matrix M*N can be obtained.

[0109] In other embodiments, the pixel position mapping relationship can be represented by a preset relationship mapping table. Exemplarily, according to the function (x', y') = (f(x), f(y)) of the current traversal pixel with respect to the target pixel in the pixel matrix M*N, and each pixel in the pixel matrix m*n, it can be determined that the current traversal pixel and the target pixel in the pixel matrix M*N have the mapping relationship shown in Table 1, and the mapping relationship shown in Table 1 can be taken as the pixel position mapping relationship.

[0110] Table 1

[0111] Current pixel Target pixel (x1,y1) ​ (x2, y2) (x2, y2) … … (x n ,y n )]]> (x n ',y n ')]]>

[0112] The above takes the determination of the pixel position mapping relationship based on the orthographic projection positions of the top-left pixel and the center pixel of the pixel matrix m*n in the pixel matrix M*N as an example to illustrate the determination method of the pixel position mapping relationship. It can be understood that, by analogy, the pixel position mapping relationship can also be determined based on any two or more of the orthographic projection positions of the top-left pixel, the top-right pixel, the bottom-right pixel, the bottom-left pixel, and the center pixel of the pixel matrix m*n in the pixel matrix M*N.

[0113] a2, traverse each pixel in the pixel matrix m*n, and based on the pixel position mapping relationship and the position of the current traversed pixel, obtain the target pixel corresponding to the position of the current traversed pixel from the pixel matrix M*N.

[0114] In some embodiments, the pixel position mapping relationship is a function of the current traversed pixel with respect to the target pixel in the pixel matrix M*N. For example, (x', y') = (f(x), f(y)), where (x, y) is the coordinate of the current traversed pixel, and (x', y') is the coordinate of the target pixel in the pixel matrix M*N. If the current traversed pixel is (x, y), the target pixel (x', y') corresponding to the position of the current traversed pixel (x, y) can be obtained from the pixel matrix M*N.

[0115] In other embodiments, the pixel position mapping relationship is represented by a pre-set relationship mapping table. For example, the current traversed pixel and the target pixel in the pixel matrix M*N have a mapping relationship as shown in Table 1 above. If the current traversed pixel is (x2, y2), the target pixel corresponding to the position (x2, y2) of the current traversed pixel is (x2', y2').

[0116] 2032, determine the correction parameter of the current traversed pixel according to the target pixel and the current traversed pixel.

[0117] In some embodiments, the difference between the pixel value of the current traversed pixel and the pixel value of the target pixel can be used as the correction parameter of the current traversed pixel.

[0118] For example, if the pixel value of the current traversed pixel is A and the pixel value of the target pixel is B, the correction parameter of the current traversed pixel can be determined as A-B=K.

[0119] 2033, based on the correction parameter and a pre-set correction function, determine the correction value of the current traversed pixel, until the traversal of each pixel in the pixel matrix m*n is completed, to obtain the correction value of each pixel in the pixel matrix m*n.

[0120] Wherein, the pre-set correction function can be of various forms. For example, the pre-set correction function can be any one of the following formulas (1), (2), (3), (4):

[0121] f(X) = k1*X + b1 Formula (1)

[0122] f(X) = sigmoid(X) Formula (2)

[0123] f(X) = k2*X a +b2 Formula (3)

[0124] f(X) = exp-loss(X) Formula (4)

[0125] Formula (1), (2), (3), (4), X represents a correction parameter, k1, k2 are weight coefficients, a, b1, b2 are constants, and 0 < a < 1.

[0126] Exemplarily, step 2033 can specifically include steps b1-b4 as follows:

[0127] b1, based on the correction parameter, obtaining a function value of the preset correction function.

[0128] For example, the preset correction function is f(X) = k1*X + b1 = 2*X - 10, if the correction parameter is 2, the function value of the preset correction function can be determined as: f(X) = 2*X + 1 = 2*2 - 10 = -6. If the correction parameter is -2, the function value of the preset correction function can be determined as: f(X) = 2*X - 10 = 2*(-2) - 10 = 6

[0129] b2, when the correction parameter is greater than a preset threshold, obtaining a difference between the correction parameter and the function value as a correction value of the current traversal pixel.

[0130] Wherein, the preset threshold can be adjusted according to actual situation, and the specific value of the preset threshold is not limited here. For example, the preset threshold can be 0.

[0131] For the convenience of understanding, the above example of step b1 is continued to explain. For example, the preset threshold is 0, the correction parameter is 2, and the function value of the preset correction function is -6. Since the correction parameter 2 is greater than the preset threshold 0, the difference 8 between the correction parameter 2 and the function value -6 of the preset correction function is taken as the correction value of the current traversal pixel.

[0132] b3, when the correction parameter is less than the preset threshold, obtaining a sum of the correction parameter and the function value as the correction value of the current traversal pixel.

[0133] For the convenience of understanding, the above example of step b1 is continued to explain. For example, the preset threshold is 0, the correction parameter is 2, and the function value of the preset correction function is 6. Since the correction parameter -2 is less than the preset threshold 0, the sum 4 of the correction parameter -2 and the function value 6 of the preset correction function is taken as the correction value of the current traversal pixel.

[0134] b4, until the traversal of each pixel in the pixel matrix m*n is completed, obtaining the correction value of each pixel in the pixel matrix m*n.

[0135] 2034、determine the corrected pixel matrix based on the correction value of each pixel in the pixel matrix m*n.

[0136] For the convenience of understanding, the following is a specific example to illustrate the process of step 2031- step 2034 corresponding to step 203 "correction operation":

[0137] 1) Traverse each pixel in the pixel matrix m*n, get the i=1th pixel in the pixel matrix m*n, wherein the i-th pixel represents the current traversal pixel, 1≤i≤m*n;

[0138] 2) From the pixel matrix M*N, get the target pixel corresponding to the position of the i=1th pixel; wherein the target pixel can be obtained in the manner described in steps a1-a2 above, which will not be repeated here;

[0139] 3) Determine the correction parameter of the i=1th pixel according to the target pixel and the i=1th pixel; wherein the determination method of the correction parameter of the i=1th pixel can refer to the description of steps 2033, b1-b4 above, which will not be repeated here;

[0140] 4) Determine the correction value of the i=1th pixel based on the correction parameter of the i=1th pixel and the preset correction function,

[0141] 5) Let i=i+1, repeat the above steps 1) to 4), until i=m*n, the traversal of each pixel in the pixel matrix m*n is completed, and the correction value of each pixel in the pixel matrix m*n is obtained;

[0142] 6) The correction value of each pixel in the pixel matrix m*n is taken as the corrected pixel matrix.

[0143] (II) The entire image feature extraction process undergoes multiple pooling operations.

[0144] When the entire image feature extraction process undergoes multiple pooling operations, a "correction operation" can be performed on the pixel matrix after each pooling operation, or only on the pixel matrix after the last pooling operation. The following will be described respectively:

[0145] Each "correction operation" can refer to the description of steps 2031-2034 above, which will not be repeated here.

[0146] 1. Only the pixel matrix after the last pooling operation is subjected to "correction operation".

[0147] For example Figure 4As shown, step 202 may specifically include performing multi-level pooling on the pixel matrix M*N to obtain a pixel matrix m*n. Correspondingly, using the methods described in steps 2031 to 2034 above, the pixel matrix m*n obtained by performing multi-level pooling on the pixel matrix M*N is subjected to the "correction operation" shown in step 203.

[0148] 2. Perform a "correction operation" on the pixel matrix after each pooling operation.

[0149] like Figure 5 As shown, steps 202 and 203 are executed alternately until the number of "pooling operations" and "correction operations" is the same as the preset number of pooling layers. Steps 202 and 203 are executed alternately to determine the corrected pixel matrix, as detailed below:

[0150] A. In the j=1th pooling layer, the j=1th pooling operation is performed on the pixel matrix M*N to obtain the j=1th pixel matrix m*n; there are a total of H pooling layers, 1≤j≤H;

[0151] B. Based on the preset correction function and pixel matrix M*N, correct each pixel in the j=1th pixel matrix m*n to obtain the j=1th corrected pixel matrix;

[0152] C. Replace the pixel matrix M*N in step A with the j=1 corrected pixel matrix, and replace the j=1 pooling layer in step A with the j=2 pooling layer. Repeat steps A to B above.

[0153] D. Repeat steps A to C above until j = H, to obtain the j = H corrected pixel matrix, which is used as the final corrected pixel matrix in step 203 for subsequent processing in step 204.

[0154] 204. Based on the corrected pixel matrix, determine the target image features of the target image.

[0155] The target image features are used to classify the target image.

[0156] For example, the corrected pixel matrix can be directly used as the target image feature of the target image.

[0157] In some embodiments, the image feature extraction method can be applied to extract image features of the image to be classified during the actual application of the trained image classification model. That is, after step 204, the following steps d1-d3 can be further included: classifying the target image according to the target image features of the target image by the trained image classification model to obtain the target classification of the target image. As shown in the following steps d1-d3, since the trained image classification model has learned the correct classification prediction parameters, the accuracy of image classification can be improved.

[0158] In some embodiments, the image feature extraction method can be applied to extract image features of the image to be classified during the training of the image classification model to be trained, and the model is trained to obtain a trained image classification model. In the application stage of actual image classification, the trained image classification model can extract image features without "correction operation". As shown in the following steps c1-c3, since the trained image classification model has learned the correct feature extraction parameters, the extraction accuracy of image features can be ensured even if the image feature extraction is not performed by the "correction operation" in the application stage of actual image classification, thereby improving the accuracy of image classification.

[0159] In some embodiments, the image feature extraction method can be applied to extract image features of the image to be classified during the training of the image classification model to be trained.

[0160] As can be seen from the above, by the pooling operation in the image feature extraction process, after obtaining the pixel matrix m*n by the conventional pooling operation, each pixel point in the pixel matrix m*n is corrected based on the preset correction function and the pixel matrix M*N to obtain a corrected pixel matrix; the target image features of the target image are determined based on the corrected pixel matrix, which can improve the accuracy of image feature extraction to a certain extent; even for images with unclear feature differences between categories, the accuracy of image feature extraction can be improved, thereby avoiding the problem of low image classification accuracy caused by the relatively low feature extraction accuracy of the existing image feature extraction method; and the accuracy of image classification is improved to a certain extent.

[0161] The following describes two applications of the "correction operation" in the training process of the image classification model to be trained.

[0162] The image classification model to be trained includes a feature extraction layer and a prediction layer.

[0163] Exemplarily, the steps 201-202 can be implemented by a feature extraction layer in the image classification model to be trained. In this case, the steps 201-202 can specifically include: performing convolution operation on the target image by the feature extraction layer in the image classification model to be trained to obtain a pixel matrix M*N of the target image; and performing pooling operation on the pixel matrix M*N to obtain a pixel matrix m*n.

[0164] Further, as shown in Figure 6 , Figure 6 is a network architecture schematic diagram of an image classification model provided in an embodiment of the present application, and the step 203 can be implemented by a feature extraction layer in the image classification model to be trained. In this case, the feature extraction layer can include a convolution layer and a plurality of pooling layers connected in sequence. The convolution layer is configured to output the pixel matrix M*N in the step 201, and the plurality of pooling layers are configured to output the corrected pixel matrix in the steps 202-203. Each pooling layer is configured to output a pixel matrix m*n after one pooling operation and correction operation, and the pixel matrix m*n is used as an input of a next pooling layer connected to the pooling layer.

[0165] Firstly, the correction operation is applied in the training process of the image classification model to be trained and in the adjustment of the model parameters of the feature extraction layer.

[0166] In some embodiments, the pixel matrix m*n can be used as a sample image feature of the target image extracted by the feature extraction layer (in the image classification model to be trained), and the corrected pixel matrix determined in the step 203 can be used as feature learning supervision information of the feature extraction layer (in the image classification model to be trained), so as to improve the feature extraction accuracy of the feature extraction layer. In this case, the image feature extraction method can further include steps c1-c3 in the training process of the image classification model to be trained:

[0167] c1, determining a sample image feature of the target image based on the pixel matrix m*n.

[0168] c2, determining a feature extraction loss of the image classification model to be trained according to the sample image feature and the target image feature.

[0169] The feature extraction loss is used to indicate the loss of the feature extraction layer of the image classification model to be trained.

[0170] c3, adjusting the model parameters of the feature extraction layer based on the feature extraction loss until a preset first stop training condition is reached, to obtain a trained image classification model.

[0171] The preset first stop training condition can be set according to actual needs. For example, it can be that when the total loss value of the image classification model to be trained is less than a preset value, or when the total loss value basically no longer changes, that is, the difference between the total loss values corresponding to adjacent multiple times of training is less than a preset value, or when the number of iterations of training of the image classification model to be trained reaches the maximum number of iterations.

[0172] The total loss value of the image classification model to be trained can be set as a feature extraction loss, or as a weighted sum of a classification loss and a feature extraction loss mentioned below.

[0173] By taking the corrected pixel matrix determined in step 203 as the feature learning supervision information of the feature extraction layer (in the image classification model to be trained), and determining the feature extraction loss of the image classification model to be trained according to the sample image features and the target image features during the training process of the image classification model to be trained, the image classification model can learn the correct feature extraction parameters, thereby avoiding the problem of low image classification accuracy caused by the relatively low feature extraction accuracy of the existing image feature extraction method, and improving the accuracy of image classification to a certain extent. Especially when the features between categories are not obviously different, the accuracy of image feature extraction can be improved to a certain extent, thereby improving the accuracy of image classification.

[0174] The second, the application of the correction operation in the adjustment process of the model parameters of the prediction layer during the training process of the image classification model to be trained.

[0175] In some embodiments, the corrected pixel matrix determined in step 203 can be used as the target image features of the target image for subsequent image classification. This avoids the problem of low classification accuracy of the prediction layer of the trained model caused by the use of image features with low accuracy in the training process for classification prediction, thereby improving the classification accuracy of the trained image classification model. At this time, the image feature extraction method during the training process of the image classification model to be trained can further include steps d1-d3:

[0176] d1, predicting the target image according to the target image features by the prediction layer in the image classification model to be trained to obtain the predicted category of the target image.

[0177] The target image is labeled with a category label.

[0178] d2, determining the classification loss of the image classification model to be trained according to the predicted category and the actual category corresponding to the category label.

[0179] The classification loss is used to indicate the loss of the prediction layer of the image classification model to be trained.

[0180] d3, adjust the model parameters of the prediction layer based on the classification loss until a preset second stop training condition is reached, to obtain a trained image classification model.

[0181] The preset second stop training condition can be set according to actual needs. For example, it can be when the total loss value of the image classification model to be trained is less than a preset value, or when the total loss value basically no longer changes, that is, the difference between the total loss values corresponding to adjacent multiple times of training is less than a preset value; or when the number of iterations of training of the image classification model to be trained reaches a maximum number of iterations.

[0182] The total loss value of the image classification model to be trained can be set as the classification loss, or as a weighted sum of the classification loss and the feature extraction loss.

[0183] By using the corrected pixel matrix determined in step 203 as the target image feature of the target image in the training process, the subsequent image classification is performed. This avoids the problem that the training process uses image features with low accuracy for classification prediction, which leads to inaccurate adjustment of the parameters of the prediction layer, and further leads to low classification accuracy of the prediction layer of the trained model. The trained image classification model has learned the correct classification prediction parameters, thereby improving the classification accuracy of the trained image classification model. Especially when the features between categories are not obviously different, the accuracy of image classification is improved to a certain extent.

[0184] In addition, in order to verify the effect brought by the "correction operation" provided in the embodiments of the present application, the scheme provided in the embodiments of the present application is also tested, as follows:

[0185] I. For images with relatively obvious differences between categories

[0186] 1. After feature extraction using the above image feature extraction method, the obtained target image feature is used for image classification, and the classification accuracy is counted, which is called: the image classification accuracy with "correction operation".

[0187] 2. After feature extraction using the ordinary image feature extraction method, the obtained target image feature is used for image classification, and the classification accuracy is counted, which is called: the image classification accuracy without "correction operation".

[0188] Among them, the image classification accuracy with "correction operation", the image classification accuracy without "correction operation", and the image classification accuracy with "correction operation" using different correction functions are shown in Table 2 as follows:

[0189] Table 2

[0190] Correction function Accuracy (precision) None 86.5% f(x) = kx + b 85.6% f(x) = sigmoid(x) 88.5% f(x) = kx a + b (0 < a < 1) 86.8% f(x) = exp-loss(x) exponential loss function 87.2%

[0191] II. Images with no obvious feature difference between categories

[0192] 3. After feature extraction using the above image feature extraction method, the target image features obtained are used for image classification, and the classification accuracy is counted, which is called: image classification accuracy after "correction operation".

[0193] 4. After feature extraction using the ordinary image feature extraction method, the target image features obtained are used for image classification, and the classification accuracy is counted, which is called: image classification accuracy without "correction operation".

[0194] Among them, the image classification accuracy after "correction operation", the image classification accuracy without "correction operation", and the image classification accuracy after "correction operation" using different correction functions are shown in Table 3 as follows:

[0195] Table 3

[0196] Correction function Accuracy (precision) None 58.5% f(x) = kx + b 59.0% f(x) = sigmoid(x) 62.1% f(x) = kx a + b (0 < a < 1) 58.9% f(x) = exp-loss(x) exponential loss function 60.2%

[0197] From the above experimental data, it can be seen that during the image feature extraction process, by correcting the pixel values after the pooling operation, i.e. performing "correction operation", the accuracy of image feature extraction can be improved, and thus the accuracy of image classification can be improved.

[0198] In order to better implement the image feature extraction method in the embodiments of the present application, based on the image feature extraction method, the embodiments of the present application also provide an image feature extraction device, as shown in Figure 7 Fig. 1 is a schematic structural diagram of an embodiment of an image feature extraction device in the embodiments of the present application. The image feature extraction device 700 includes:

[0199] The convolution unit 701 is configured to perform convolution operation on a target image to be subjected to feature extraction, to obtain a pixel matrix M*N of the target image.

[0200] The pooling unit 702 is configured to perform pooling operation on the pixel matrix M*N to obtain a pixel matrix m*n.

[0201] The correction unit 703 is configured to correct each pixel point in the pixel matrix m*n based on a preset correction function and the pixel matrix M*N, to obtain a corrected pixel matrix.

[0202] The determination unit 704 is configured to determine a target image feature of the target image based on the corrected pixel matrix, wherein the target image feature is used for classifying the target image.

[0203] In some embodiments, the correction unit 703 is specifically configured to:

[0204] traverse each pixel in the pixel matrix m*n, and obtain a target pixel corresponding to a current traversed pixel position from the pixel matrix M*N;

[0205] determine a correction parameter of the current traversed pixel according to the target pixel and the current traversed pixel;

[0206] determine a correction value of the current traversed pixel based on the correction parameter and a preset correction function, until the traversal of each pixel in the pixel matrix m*n is completed, to obtain the correction value of each pixel in the pixel matrix m*n;

[0207] determine the corrected pixel matrix based on the correction value of each pixel in the pixel matrix m*n.

[0208] In some embodiments, the correction unit 703 is specifically configured to:

[0209] obtain a difference between a pixel value of the current traversed pixel and a pixel value of the target pixel as the correction parameter of the current traversed pixel.

[0210] In some embodiments, the correction unit 703 is specifically configured to:

[0211] obtain a function value of the preset correction function based on the correction parameter;

[0212] when the correction parameter is greater than a preset threshold, obtain a difference between the correction parameter and the function value as the correction value of the current traversed pixel;

[0213] when the correction parameter is less than a preset threshold, obtain a sum of the correction parameter and the function value as the correction value of the current traversed pixel;

[0214] until the traversal of each pixel in the pixel matrix m*n is completed, to obtain the correction value of each pixel in the pixel matrix m*n.

[0215] In some embodiments, the correction unit 703 is specifically configured to:

[0216] obtain a pixel position mapping relationship between the pixel matrix m*n and the pixel matrix M*N;

[0217] traverse each pixel in the pixel matrix m*n, and obtain a target pixel corresponding to a current traversed pixel position from the pixel matrix M*N based on the pixel position mapping relationship and a position of the current traversed pixel.

[0218] In some embodiments, the correction unit 703 is specifically configured to:

[0219] obtaining a first center pixel of the pixel matrix M*N as a first orthographic projection position of a second center pixel of the pixel matrix m*n on the pixel matrix M*N;

[0220] determining a second orthographic projection position of an upper left pixel in the pixel matrix m*n on the pixel matrix M*N based on an upper left pixel of the pixel matrix M*N, a width and a height of the pixel matrix M*N, and a width and a height of the pixel matrix m*n;

[0221] determining the pixel position mapping relationship based on the first orthographic projection position and the second orthographic projection position.

[0222] In some embodiments, the preset correction function is one of f(X)=k1*X+b1, f(X)=sigmoid(X), f(X)=k2*Xa+b2, and f(X)=exp-loss(X), where X represents a correction parameter, k1 and k2 are weight coefficients, a, b1 and b2 are constants, and 0

[0223] In some embodiments, the pooling unit 702 is specifically configured to:

[0224] performing a max-pooling operation on the pixel matrix M*N to obtain a pixel matrix m*n;

[0225] or, performing an average-pooling operation on the pixel matrix M*N to obtain a pixel matrix m*n.

[0226] In some embodiments, the convolution unit 701 is specifically configured to:

[0227] performing a convolution operation on the target image through a feature extraction layer in the image classification model to be trained to obtain a pixel matrix M*N of the target image;

[0228] In some embodiments, the pooling unit 702 is specifically configured to:

[0229] performing a pooling operation on the pixel matrix M*N to obtain a pixel matrix m*n;

[0230] In some embodiments, the image feature extraction apparatus further comprises a training unit (not shown in the figure), which is specifically configured to:

[0231] determining a sample image feature of the target image based on the pixel matrix m*n;

[0232] determining a feature extraction loss of the image classification model to be trained according to the sample image feature and the target image feature;

[0233] Based on the feature extraction loss, the model parameters of the feature extraction layer are adjusted until a preset first stop training condition is reached, and a trained image classification model is obtained.

[0234] In some embodiments, the target image is labeled with a category label, and the training unit is specifically configured to:

[0235] Through a prediction layer in the to-be-trained image classification model, the target image feature is predicted to obtain a predicted category of the target image.

[0236] According to the actual category corresponding to the predicted category and the category label, a classification loss of the to-be-trained image classification model is determined.

[0237] Based on the classification loss, the model parameters of the prediction layer are adjusted until a preset second stop training condition is reached, and a trained image classification model is obtained.

[0238] In specific implementation, the above various units can be implemented as independent entities, or can be combined as the same or several entities, and the specific implementation of the above various units can be referred to the method embodiments above, which will not be described here.

[0239] Since the image feature extraction device can perform the method of the present application as described above Figures 1-6 According to the steps in the image feature extraction method of any embodiment, the method of the present application as described above Figures 1-6 According to the beneficial effects of the image feature extraction method of any embodiment, which are described above, and will not be described here.

[0240] In addition, in order to better implement the image feature extraction method in the embodiments of the present application, based on the image feature extraction method, the embodiments of the present application also provide an electronic device, which is described in detail Figure 8 , Figure 8 A structural schematic diagram of the electronic device of the embodiments of the present application is shown, and specifically, the electronic device provided by the embodiments of the present application includes a processor 801, which is configured to implement the functions of the image feature extraction method as described above when executing the computer program stored in the memory 802. Figures 1-6 According to the steps of the image feature extraction method of any embodiment; or the processor 801 is configured to implement the functions of the units in the embodiments when executing the computer program stored in the memory 802. Figure 7 According to the functions of the units in the embodiments.

[0241] For example, the computer program can be divided into one or more modules / units, one or more modules / units are stored in the memory 802 and executed by the processor 801 to complete the embodiments of the present application. One or more modules / units can be a series of computer program instruction segments capable of completing a specific function, which is used to describe the execution process of the computer program in the computer device.

[0242] The electronic device can include, but is not limited to, the processor 801, the memory 802. Those skilled in the art can understand that the schematic diagram is only an example of the electronic device and does not constitute a limitation on the electronic device, and can include more or fewer components than the schematic diagram, or combine certain components, or different components, for example, the electronic device can also include an input / output device, a network access device, a bus, etc. The processor 801, the memory 802, the input / output device, and the network access device are connected through the bus.

[0243] The processor 801 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The processor is the control center of the electronic device, and connects all parts of the electronic device through various interfaces and lines.

[0244] The memory 802 can be used to store computer programs and / or modules, and the processor 801 implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory 802, and calling data stored in the memory 802. The memory 802 can mainly include a program storage area and a data storage area, wherein the program storage area can store operating systems, application programs required by at least one function (such as a sound playing function, an image playing function, etc.), etc.; and the data storage area can store data created according to the use of the electronic device (such as audio data, video data, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, for example, a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state memory devices.

[0245] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the image feature extraction device, the electronic device and the corresponding units described above can be referred to as Figures 1-6 The description of the image feature extraction method corresponding to any embodiment is not repeated here.

[0246] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by related hardware controlled by the instructions, which can be stored in a computer readable storage medium and loaded and executed by a processor.

[0247] Therefore, the embodiments of the present application provide a computer readable storage medium, which stores a plurality of instructions. The instructions can be loaded by a processor to execute the embodiments of the present application as Figures 1-6 The specific operations of the steps in the image feature extraction method corresponding to any embodiment can be referred to as Figures 1-6 The description of the image feature extraction method corresponding to any embodiment is not repeated here.

[0248] The computer readable storage medium can include a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0249] Due to the instructions stored in the computer readable storage medium, the embodiments of the present application as Figures 1-6 The steps in the image feature extraction method corresponding to any embodiment can be implemented, so that the embodiments of the present application as Figures 1-6The beneficial effects that can be achieved by the image feature extraction method in any embodiment correspond to the description above, and will not be repeated here.

[0250] The above describes in detail the image feature extraction method, device, electronic equipment and computer readable storage medium provided by the embodiments of the present application. The principles and implementation manners of the present application are described by applying specific examples. The above embodiment description is only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, the specific implementation manner and application range will be changed according to the idea of the present application. In summary, the content of the specification should not be understood as a limitation of the present application.

Claims

1. An image feature extraction method characterized by, The method comprises: performing a convolution operation on a target image to be subjected to feature extraction to obtain a pixel matrix of the target image ; performing a pooling operation on the pixel matrix to obtain a pixel matrix ; traversing the pixel matrix each pixel in the pixel matrix obtaining a target pixel corresponding to a current traversed pixel position from the pixel matrix obtaining a difference between a pixel value of the current traversal pixel and a pixel value of the target pixel as a correction parameter of the current traversal pixel; obtaining a function value of a preset correction function based on the correction parameter; when the correction parameter is greater than a preset threshold, obtaining a difference between the correction parameter and the function value as a correction value of the current traversal pixel; when the correction parameter is less than a preset threshold, obtaining a sum of the correction parameter and the function value as a correction value of the current traversal pixel; until the pixel matrix each pixel is traversed, obtaining the pixel matrix correction values of the pixels in the matrix based on the pixel matrix corrected values of the pixels in the matrix, to determine a corrected pixel matrix; determining a target image feature of the target image based on the corrected pixel matrix, wherein the target image feature is used for classifying the target image.

2. The image feature extraction method of claim 1, wherein, The traversing the pixel matrix each pixel in the pixel matrix, comprises: obtaining a target pixel corresponding to a current traversed pixel position from the pixel matrix, comprises: acquiring the pixel matrix a pixel position mapping relationship between the pixel matrix ​ traversing the pixel matrix In each pixel, based on the pixel position mapping relationship and the position of the current traversed pixel, the target pixel corresponding to the current traversed pixel position is obtained from the pixel matrix In each pixel, based on the pixel position mapping relationship and the position of the current traversed pixel, the target pixel corresponding to the current traversed pixel position is obtained from the pixel matrix 3. The image feature extraction method of claim 2, wherein, The obtaining the pixel matrix The pixel position mapping relationship between the pixel matrix includes: Obtain the pixel matrix The first center pixel, as the pixel matrix The second center pixel in the pixel matrix The first orthographic projection position on; based on an upper left pixel of the pixel matrix a width and a height of the pixel matrix a width and a height of the pixel matrix a second orthographic position on the pixel matrix based on an upper left pixel of the pixel matrix a width and a height of the pixel matrix Based on the first orthographic position and the second orthographic position, the pixel position mapping relationship is determined.

4. The image feature extraction method of claim 1, wherein, The preset correction function is one of f(X)=k1 X+b1, f(X)=sigmoid(X), f(X)=k2 X a +b2, f(X)=exp-loss(X), wherein X represents a correction parameter, k1 and k2 are weight coefficients, a, b1 and b2 are constants, and 0 5. The image feature extraction method of claim 1, wherein, The pixel matrix is obtained by performing a pooling operation on the pixel matrix The pixel matrix is obtained by performing a pooling operation on the pixel matrix , comprising: performing a max-pooling operation on the pixel matrix to obtain a pixel matrix ; Or, the pixel matrix is subjected to an average pooling operation to obtain a pixel matrix .

6. The image feature extraction method according to any one of claims 1-5, characterized in that, The target image to be subjected to feature extraction is subjected to a convolution operation to obtain a pixel matrix of the target image The pixel matrix is subjected to a pooling operation to obtain a pixel matrix The pixel matrix perform a convolution operation on the target image through a feature extraction layer in the image classification model to be trained to obtain a pixel matrix of the target image ; perform a pooling operation on the pixel matrix to obtain a pixel matrix ; The method further comprises: based on the pixel matrix determining sample image features of the target image; determining a feature extraction loss of the to-be-trained image classification model according to the sample image feature and the target image feature; based on the feature extraction loss, adjusting the model parameters of the feature extraction layer until a preset first stop training condition is reached, obtaining a trained image classification model.

7. The image feature extraction method according to any one of claims 1-5, characterized in that, The target image is labeled with a category label. The target image to be subjected to feature extraction is subjected to a convolution operation to obtain a pixel matrix of the target image The pixel matrix is subjected to a pooling operation to obtain a pixel matrix The pixel matrix perform a convolution operation on the target image through a feature extraction layer in the image classification model to be trained to obtain a pixel matrix of the target image ; perform a pooling operation on the pixel matrix to obtain a pixel matrix ; The method further comprises: obtaining a predicted category of the target image through a prediction layer in the to-be-trained image classification model according to the target image feature; determining a classification loss of the to-be-trained image classification model according to the predicted category and an actual category corresponding to the category label; based on the classification loss, adjusting the model parameters of the prediction layer until a preset second stop training condition is reached, obtaining a trained image classification model.

8. An image feature extraction apparatus characterized by comprising: The image feature extraction device comprises: a convolution unit configured to perform a convolution operation on a target image to be subjected to feature extraction to obtain a pixel matrix of the target image ; a pooling unit configured to perform a pooling operation on the matrix of pixels to obtain a matrix of pixels a pooling unit configured to perform a pooling operation on the matrix of pixels to obtain a matrix of pixels ; Correction unit, used to traverse the pixel matrix Each pixel in the pixel matrix The process involves: obtaining the target pixel corresponding to the current traversed pixel position; obtaining the difference between the pixel value of the current traversed pixel and the pixel value of the target pixel, as a correction parameter for the current traversed pixel; obtaining the function value of a preset correction function based on the correction parameter; when the correction parameter is greater than a preset threshold, obtaining the difference between the correction parameter and the function value, as a correction value for the current traversed pixel; when the correction parameter is less than the preset threshold, obtaining the sum of the correction parameter and the function value, as a correction value for the current traversed pixel; and so on until the pixel matrix is ​​reached. When all pixels have been traversed, the pixel matrix is ​​obtained. The correction value of each pixel in the matrix; based on the pixel matrix The corrected pixel matrix is ​​determined by the corrected values ​​of each pixel. a determination unit configured to determine a target image feature of the target image based on the corrected pixel matrix, wherein the target image feature is used for classifying the target image.

9. An electronic device, comprising: comprising a processor and a memory, the memory storing a computer program, the processor invoking the computer program in the memory to execute the image feature extraction method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, having a computer program stored thereon, the computer program being loaded by a processor to execute the steps in the image feature extraction method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image segmentation method based on enhanced characteristic representation

    CN112085746A

  • Hyperspectral image ground object classification method based on spectral segmentation and homogeneous region detection

    CN112308152A