Image processing method and device, computer device, storage medium and program product
Patent Information
- Application Number
- CN202310659343.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-05
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2043-06-05
AI Technical Summary
[0003]传统技术中,主要是通过人工对图像中的图案进行分类识别,因此,传统技术存在对图像中的物体分类识别的效率较低的问题
[0040] The aforementioned image processing methods, apparatus, computer equipment, storage media, and program products acquire an image to be processed and input it into a preset classification model that includes a data processing layer that performs dimensionality reduction processing on the feature information of the image to be processed. Since the classification model includes the aforementioned data processing layer, the feature information output by the underlying network in the classification model can be reduced using this data processing layer, thereby reducing the amount of feature data transmitted to the classifier in the classification model. This improves the processing speed of the classification model on the image to be processed, and thus improves the efficiency of the classification model in classifying and recognizing objects in the image to be processed. In addition, compared with manual classification and recognition of the image to be processed, the classification model can quickly and accurately obtain the category information of each object in the image to be processed, thereby reducing labor and time costs.
Smart Images

Figure CN116883716B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to an image processing method, apparatus, computer equipment, storage medium, and program product. Background Technology
[0002] Typically, by classifying and recognizing objects in an image, corresponding processing can be performed based on the category information of the objects in the image. For example, classifying and recognizing patterns in commemorative coin images can determine the issuance time of the commemorative coin based on different categories of patterns.
[0003] In traditional technologies, the classification and recognition of patterns in images are mainly done manually. Therefore, traditional technologies suffer from low efficiency in classifying and recognizing objects in images. Summary of the Invention
[0004] Therefore, it is necessary to provide an image processing method, apparatus, computer equipment, storage medium, and program product that can improve the efficiency of object classification and recognition in images, addressing the aforementioned technical problems.
[0005] Firstly, this application provides an image processing method. The method includes:
[0006] Obtain the image to be processed;
[0007] The image to be processed is input into a preset classification model to obtain the category information of each object in the image to be processed; wherein, the classification model includes a data processing layer for dimensionality reduction of the feature information of the image to be processed.
[0008] In one embodiment, the classification model further includes a first processing network and a second processing network; the first processing network includes the data processing layer; the step of inputting the image to be processed into the preset classification model to obtain the category information of each object in the image to be processed includes:
[0009] The image to be processed is input into the first processing network to obtain the dimension-reduced feature information corresponding to the image to be processed.
[0010] The feature information after dimensionality reduction is input into the second processing network to classify each object in the image to be processed, thereby obtaining the category information of each object.
[0011] In one embodiment, the first processing network includes a first convolutional layer, a first data processing layer, a second convolutional layer, and a second data processing layer; the step of inputting the image to be processed into the first processing network to obtain the dimensionality-reduced feature information corresponding to the image to be processed includes:
[0012] The image to be processed is input into the first convolutional layer to obtain the first feature information of the image to be processed;
[0013] The first feature information is input into the first data processing layer to obtain the second feature information corresponding to the first feature information; the number of channels of the second feature information is less than the number of channels of the first feature information.
[0014] The second feature information is input into the second convolutional layer to obtain the third feature information corresponding to the second feature information; the feature quantity of the third feature information is less than the feature quantity of the second feature information.
[0015] The third feature information is input into the second data processing layer to obtain the feature information after dimensionality reduction; the number of channels of the feature information after dimensionality reduction is less than the number of channels of the third feature information.
[0016] In one embodiment, the step of inputting the first feature information into the first data processing layer to obtain the second feature information corresponding to the first feature information includes:
[0017] The data of the target dimension in the first feature information are merged to obtain the processed feature information;
[0018] Based on the processed feature information and the target dimension data, a feature matrix is obtained; the feature matrix represents the matrix after dimensional transformation of the first feature information.
[0019] The feature matrix is decomposed to obtain a coefficient matrix; the coefficient matrix represents a matrix composed of the vectors from the first column to the Nth column of the feature matrix.
[0020] The target matrix is obtained based on the coefficient matrix and the feature matrix;
[0021] The second feature information is obtained based on the target matrix.
[0022] In one embodiment, the training process of the classification model includes:
[0023] Obtain sample images and gold standard category information for each sample object in the sample images;
[0024] The sample image is input into an initial classification model to obtain sample category information for each sample object in the sample image; wherein, the initial classification model includes an initial data processing layer for dimensionality reduction of the feature information of the sample image;
[0025] The initial classification model is trained based on the gold standard category information and the sample category information of each sample object to obtain the classification model.
[0026] In one embodiment, the initial classification model further includes a first initial processing network and a second initial processing network; the first initial processing network includes the initial data processing layer; the step of inputting the sample image into the initial classification model to obtain sample category information corresponding to each sample object in the sample image includes:
[0027] The sample image is input into the first initial processing network to obtain the dimensionality-reduced sample feature information corresponding to the sample image;
[0028] The dimensionality-reduced sample feature information is input into the second initial processing network to classify each sample object in the sample image, thereby obtaining the sample category information of each sample object.
[0029] In one embodiment, the first initial processing network includes a first initial convolutional layer, a first initial data processing layer, a second initial convolutional layer, and a second initial data processing layer; the step of inputting the sample image into the first initial processing network to obtain the dimensionality-reduced sample feature information corresponding to the sample image includes:
[0030] The sample image is input into the first initial convolutional layer to obtain the first sample feature information of the sample image;
[0031] The first sample feature information is input into the first initial data processing layer to obtain the second sample feature information corresponding to the first sample feature information; the number of channels of the second sample feature information is less than the number of channels of the first sample feature information.
[0032] The second sample feature information is input into the second initial convolutional layer to obtain the third sample feature information corresponding to the second sample feature information; the feature quantity of the third sample feature information is less than the feature quantity of the second sample feature information.
[0033] The third sample feature information is input into the second initial data processing layer to obtain the dimensionality-reduced sample feature information; the number of channels in the dimensionality-reduced sample feature information is less than the number of channels in the third sample feature information.
[0034] Secondly, this application also provides an image processing apparatus. The apparatus includes:
[0035] The first acquisition module is used to acquire the image to be processed;
[0036] The second acquisition module is used to input the image to be processed into a preset classification model to obtain the category information of each object in the image to be processed; wherein, the classification model includes a data processing layer for dimensionality reduction processing of the feature information of the image to be processed.
[0037] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method described in the first aspect.
[0038] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the method described in the first aspect.
[0039] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the method described in the first aspect.
[0040] The aforementioned image processing methods, apparatus, computer equipment, storage media, and program products acquire an image to be processed and input it into a preset classification model that includes a data processing layer that performs dimensionality reduction processing on the feature information of the image to be processed. Since the classification model includes the aforementioned data processing layer, the feature information output by the underlying network in the classification model can be reduced using this data processing layer, thereby reducing the amount of feature data transmitted to the classifier in the classification model. This improves the processing speed of the classification model on the image to be processed, and thus improves the efficiency of the classification model in classifying and recognizing objects in the image to be processed. In addition, compared with manual classification and recognition of the image to be processed, the classification model can quickly and accurately obtain the category information of each object in the image to be processed, thereby reducing labor and time costs. Attached Figure Description
[0041] Figure 1 This is an application environment diagram of an image processing method in one embodiment;
[0042] Figure 2 This is a flowchart illustrating an image processing method in one embodiment;
[0043] Figure 3 This is a flowchart illustrating the image processing method in another embodiment;
[0044] Figure 4 This is a schematic diagram of the classification model in one embodiment;
[0045] Figure 5 This is a flowchart illustrating the image processing method in another embodiment;
[0046] Figure 6 This is a schematic diagram of the classification model in another embodiment;
[0047] Figure 7 This is a schematic diagram of the classification model in another embodiment;
[0048] Figure 8 This is a flowchart illustrating the image processing method in another embodiment;
[0049] Figure 9 This is a flowchart illustrating the image processing method in another embodiment;
[0050] Figure 10 This is a flowchart illustrating the image processing method in another embodiment;
[0051] Figure 11 This is a flowchart illustrating the image processing method in another embodiment;
[0052] Figure 12 This is a structural block diagram of an image processing device in one embodiment;
[0053] Figure 13 This is a structural block diagram of an image processing apparatus in another embodiment. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0055] It should be noted that the image processing method, apparatus, computer equipment, storage medium, and program product of the present invention can be used in the field of artificial intelligence, or in any technical field other than artificial intelligence. The present invention does not limit the application field of the image processing method, apparatus, computer equipment, storage medium, and program product.
[0056] The image processing method provided in this application embodiment can be applied to, for example... Figure 1 The application environment shown. Figure 1 A computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 1As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores data of the images to be processed. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements an image processing method.
[0057] It should be noted that the image processing method provided in this application can be applied to scenarios where objects in various images are classified and identified. For example, it can be applied to the classification and identification of various patterns in commemorative coin images, the classification and identification of ticket types in ticket images, etc. The embodiments of this application are not limited here.
[0058] In one embodiment, such as Figure 2 As shown, an image processing method is provided, which is applied to... Figure 1 Taking a computer device as an example, the explanation includes the following steps:
[0059] S201, Obtain the image to be processed.
[0060] The image to be processed refers to the image in which the objects in the image need to be classified and identified. Optionally, the image to be processed may include an image of a single type of object or an image of multiple types of objects. For example, taking the image to be processed as a commemorative coin image, the commemorative coin image may include only one type of pattern or multiple types of patterns.
[0061] Optionally, in this embodiment, the image to be processed can be acquired in real time by an image acquisition device and sent to a computer device. Alternatively, the image to be processed can be obtained from a preset image database. Or, a video containing the image to be processed can be acquired by the image acquisition device, and the computer device obtains the image to be processed by performing frame sampling on the acquired video. For example, taking commemorative coin images as an example, commemorative coin images under different lighting conditions can be acquired by the image acquisition device as images to be processed. Alternatively, commemorative coin images at different acquisition angles can be acquired by the image acquisition device and used as images to be processed. The image acquisition device can be an electronic device such as a camera, camcorder, or mobile phone.
[0062] S202, the image to be processed is input into a preset classification model to obtain the category information of each object in the image to be processed; wherein, the classification model includes a data processing layer for dimensionality reduction of the feature information of the image to be processed.
[0063] Optionally, the preset classification model can be a convolutional neural network model, a recurrent neural network model, or a generative adversarial network model; this embodiment does not impose any limitations on this. As an optional implementation, the preset classification model can be obtained by training an initial neural network model based on an image containing gold standard category information. Here, the category information of each object in the image to be processed refers to the category to which each object in the image belongs. For example, in a scenario where the image to be processed is a commemorative coin image, the aforementioned category information can include categories such as architecture, animals, flowers, and landscapes.
[0064] As an optional implementation, the classification model may include an input layer, a processing layer, and an output layer. During the processing of the image to be processed in the processing layer, since the output of the lower processing layer contains a large amount of repetitive feature information, the amount of data transmitted to the higher processing layer will be redundant, resulting in low processing efficiency of the classification model. Therefore, in this embodiment, a data processing layer can be added to the classification model to perform dimensionality reduction processing on the feature information in the output of the lower processing layer. By processing the feature information after dimensionality reduction, the processing efficiency of the classification model on the image to be processed can be improved.
[0065] In this embodiment, the image to be processed can be converted into a format that the classification model can process through the input layer. Then, the converted image to be processed is input into the bottom processing layer of the classification model to obtain shallow feature information of the image to be processed. The shallow feature information is input into the data processing layer, and the data processing layer performs data dimensionality reduction processing on the shallow feature information to filter out duplicate feature information and obtain intermediate feature information that can maximize the representation of shallow feature information. The intermediate feature information is then input into the high processing layer of the classification model to obtain deep feature information of the image to be processed. Based on the deep feature information, each object in the image to be processed is classified and identified to obtain the category information of each object in the image to be processed.
[0066] In the above image processing method, the image to be processed is acquired and input into a preset classification model that includes a data processing layer for dimensionality reduction of the image's feature information. Since the classification model includes the aforementioned data processing layer, the feature information output by the underlying network in the classification model can be reduced using this layer, thereby reducing the amount of feature data transmitted to the classifier in the classification model. This improves the processing speed of the classification model for the image to be processed, and thus improves the efficiency of the classification model in classifying and recognizing objects in the image. In addition, compared with manual classification and recognition of the image to be processed, the classification model can quickly and accurately obtain the category information of each object in the image to be processed, thus reducing labor and time costs.
[0067] The aforementioned preset classification model may include a first processing network and a second processing network. The first processing network may include a data processing layer. The process of classifying and recognizing objects in the image to be processed using the first and second processing networks will be described in detail below. In one embodiment, such as Figure 3 As shown, the above S202 includes:
[0068] S301, input the image to be processed into the first processing network to obtain the feature information of the image after dimensionality reduction.
[0069] In this embodiment, the classification model includes a first processing network and a second processing network. The first processing network includes a data processing layer, and their connection relationship can be as follows: Figure 4 As shown, it can be understood that after the image to be processed is input into the classification model, the image to be processed can first be processed by the first processing network of the classification model to obtain the feature information after dimensionality reduction, and then the feature information after dimensionality reduction can be input into the second processing network to obtain the classification and recognition results of each object in the image to be processed.
[0070] The first processing network may include one or more data processing layers to perform dimensionality reduction on the feature information output by the lower processing layers in the first processing network. For example, if the first processing network includes three convolutional layers, a data processing layer may be added after each convolutional layer to perform dimensionality reduction on the feature information output by the corresponding convolutional layer.
[0071] It should be noted that, in order to improve the classification performance and efficiency of the classification model in classifying and recognizing the images to be processed, an appropriate number of convolutional layers and corresponding data processing layers can be set in the first processing network. For example, if the first processing network includes one convolutional layer and one corresponding data processing layer, there will be a problem that the redundancy of the feature information of the image to be processed after dimensionality reduction obtained by the first processing network is still relatively high, resulting in a large amount of data input to the higher processing layers of the classification model, which cannot effectively reduce the amount of data processed. Alternatively, if the first processing network includes five convolutional layers and five corresponding data processing layers, there will be a problem that the feature information of the image to be processed after dimensionality reduction obtained by the first processing network is relatively small, which cannot maximize the representation of the information of each object in the image to be processed, resulting in low accuracy of the category information of each object output by the classification model. In a preferred embodiment, the first processing network may include two convolutional layers and corresponding data processing layers. That is, the first processing network may include a first convolutional layer, a first data processing layer, a second convolutional layer, and a second data processing layer. The image to be processed can be sequentially input into the first convolutional layer, the first data processing layer, the second convolutional layer, and the second data processing layer for processing to obtain the dimensionality-reduced feature information of the image. The processing procedure of inputting the image to be processed into the first processing network is described in detail below. Figure 5 As shown, the above S301 includes:
[0072] S401, the image to be processed is input into the first convolutional layer to obtain the first feature information of the image to be processed.
[0073] The first convolutional layer refers to the first convolutional layer in the first processing network that performs convolutional processing on the image to be processed. The first convolutional layer may include several convolutional kernels, which can be used to perform convolutional processing on the pixels of the image to be processed, obtaining the first feature information of the image. Optionally, the convolutional processing method can be one-dimensional convolution or two-dimensional convolution; this embodiment does not limit this. The first feature information of the image to be processed can be the edge feature information of the image.
[0074] In this embodiment, the image to be processed can be input into the first convolutional layer. The pre-set convolutional kernel in the first convolutional layer performs convolution processing on all pixels of the image to be processed, thereby obtaining the pixel information after convolution processing. The pixel information after convolution processing is used as the first feature information of the image to be processed.
[0075] S402, the first feature information is input into the first data processing layer to obtain the second feature information corresponding to the first feature information; the number of channels of the second feature information is less than the number of channels of the first feature information.
[0076] The second feature information refers to the feature information obtained after dimensionality reduction of the first feature information. It should be noted that the input layer can process the image to be processed into an image containing multiple channels. After the first convolutional layer processes the image with multiple channels, it will obtain a large amount of repetitive feature information. Therefore, the first data processing layer can reduce the dimensionality of the number of channels of the first feature information to obtain the second feature information with a smaller number of channels than the number of channels of the first feature information.
[0077] In this embodiment, the output of the first convolutional layer is connected to the input of the first data processing layer, so that the first feature information can be input into the first data processing layer. The first data processing layer can reduce the number of channels of the first feature information by performing matrix transformations on the first feature information, thereby obtaining the second feature information.
[0078] S403, the second feature information is input into the second convolutional layer to obtain the third feature information corresponding to the second feature information; the feature quantity of the third feature information is less than the feature quantity of the second feature information.
[0079] In this context, the second convolutional layer refers to the second convolutional layer in the first processing network that performs convolutional processing on the image to be processed. The output of the first data processing layer is connected to the input of the second convolutional layer. The third feature information refers to the output of the second convolutional layer. The third feature information may include local feature information of the image to be processed. It can be understood that the second convolutional layer performs further feature extraction processing on the second feature information. Therefore, the feature quantity of the obtained third feature information is less than that of the second feature information.
[0080] In this embodiment, the second feature information output from the first data processing layer can be input into the second convolutional layer. The second feature information is then convolved by a preset convolutional kernel in the second convolutional layer, and the pixel information after convolution is used as the third feature information of the image to be processed.
[0081] S404, the third feature information is input into the second data processing layer to obtain the feature information after dimensionality reduction; the number of channels of the feature information after dimensionality reduction is less than the number of channels of the third feature information.
[0082] The internal structure of the second data processing layer can be the same as that of the first data processing layer. The second data processing layer can be used to reduce the dimensionality of the third feature information, so as to obtain the feature information after dimensionality reduction with a smaller number of channels than the third feature information.
[0083] In this embodiment, the output of the second convolutional layer is connected to the input of the second data processing layer, so that the third feature information can be input into the second data processing layer. The second data processing layer can reduce the number of channels of the second feature information by performing matrix transformation on the second feature information, thereby obtaining the feature information after dimensionality reduction.
[0084] As another optional implementation, the first processing network may further include a first pooling layer and a second pooling layer, then in the above... Figure 3 Based on this, the connection relationship between the first processing network and the second processing network in the classification model can be as follows: Figure 6 As shown, the input order of the image to be processed in the classification model is: input layer - first convolutional layer - first data processing layer - first pooling layer - second convolutional layer - second data processing layer - second pooling layer - second processing network. That is, after the image to be processed is input into the classification model, it can be processed sequentially through the input layer - first convolutional layer - first data processing layer - first pooling layer - second convolutional layer - second data processing layer - second pooling layer - second processing network to obtain the category information of each object in the image to be processed.
[0085] S302, the feature information after dimensionality reduction is input into the second processing network to classify each object in the image to be processed and obtain the category information of each object.
[0086] The second processing network refers to a processing network that classifies and identifies objects in the image to be processed based on the feature information after dimensionality reduction. For example, it can be a classifier. Multiple convolutional layers and multiple fully connected layers can be set in the second processing network. For instance, four convolutional layers (the third, fourth, fifth, and sixth convolutional layers) and two fully connected layers (the first and second fully connected layers) can be set in the second processing network. Taking the structure of the first processing network (including the first convolutional layer, the first data processing layer, the second convolutional layer, and the second data processing layer) and the second processing network (including the third, fourth, fifth, and sixth convolutional layers, the first fully connected layer, and the second fully connected layer) as an example, the structure of the second processing network of the classification model can be as follows: Figure 7 As shown. In this embodiment, the dimensionality-reduced feature information can be sequentially input into the third, fourth, fifth, and sixth convolutional layers of the second processing network to obtain the deep feature information of the image to be processed. The deep feature information can be the deep feature information of local images including regions of interest in the image to be processed. Furthermore, the local deep feature information of the image to be processed can be sequentially input into the first and second fully connected layers to classify the objects in the image to be processed, thereby obtaining the category information of each object.
[0087] In this embodiment, the image to be processed is input into the first processing network to obtain the dimensionality-reduced feature information corresponding to the image to be processed. The dimensionality-reduced feature information is then input into the second processing network to classify the objects in the image to be processed, thereby obtaining the category information of each object. Since the first processing network performs dimensionality reduction processing on the feature information output by the convolutional layer through the data processing layer, the amount of data input to the second processing network is reduced, thereby improving the processing speed of the classification model in the image to be processed, and thus improving the efficiency of obtaining the category information of each object in the image to be processed.
[0088] In the scenario described above, where the dimensionality-reduced feature information of the image to be processed is obtained through the data processing layer in the first processing network, the output results of each convolutional layer of the first processing network can be input into the corresponding data processing layer to obtain the dimensionality-reduced feature information. The detailed process of the first data processing layer in the first processing network processing the first feature information of the image to be processed will be explained below. In one embodiment, such as... Figure 8 As shown, the above S402 includes:
[0089] S501, merge the data of the target dimension in the first feature information to obtain the processed feature information.
[0090] The first feature information can be represented in the form of a matrix. The dimensions of the matrix can include the number of channels of the image to be processed, the number of horizontal pixels of the image to be processed, and the number of vertical pixels of the image to be processed. In this embodiment, the dimensions of the number of channels of the image to be processed and the number of horizontal pixels of the image to be processed can be used as the target dimensions. By merging the target dimensions, the processed feature information with reduced dimensions can be obtained.
[0091] Taking the matrix X of the first feature information as having dimensions [C, M, N] as an example, where C represents the number of channels of the image to be processed, M represents the number of horizontal pixels of the input image, and N represents the number of vertical pixels of the image to be processed, then merging the data of the target dimension in the first feature information can be expressed as processing the dimension [C, M, N] of X into [C, M*N], that is, the processed feature information can be represented as a matrix X1 with dimensions [C, M*N].
[0092] S502, based on the processed feature information and the target dimension data, obtain the feature matrix; the feature matrix represents the matrix after dimensional transformation of the first feature information.
[0093] In this embodiment, taking the processed feature information as X1 and the target dimension data as M*N as an example, we can use the matrix transformation formula X2=X1X1 to calculate the result. T / (M*N), yielding the feature matrix, where X2 in the matrix transformation formula is the feature matrix, and X1 is the processed feature information.T Let X1 be the transpose of X1, and M*N represent the data in the target dimension.
[0094] S503 decomposes the feature matrix to obtain the coefficient matrix; the coefficient matrix represents the matrix composed of the vectors from the first column to the Nth column of the feature matrix.
[0095] Here, the coefficient matrix refers to the matrix in the feature matrix that can maximize the representation of the feature information of the image to be processed. In this embodiment, the vectors from the first column to the Nth column of the feature matrix can be selected as the coefficient matrix, and the value of N can be determined according to the data dimension of the image to be processed input to the classification model. In this embodiment, taking the feature matrix X2 as an example, the feature matrix is decomposed, that is, the matrix X2 can be decomposed into matrix U, matrix S and matrix V. As an optional implementation method, matrix U includes the feature information that can maximize the representation of the image to be processed. Therefore, the coefficient matrix U1 can be constructed based on the first C1 column vectors of matrix U. It can be understood that the dimension of the constructed coefficient matrix U1 is [C, C1], where C1 is less than C.
[0096] S504. Based on the coefficient matrix and the characteristic matrix, the target matrix is obtained.
[0097] In this embodiment, as an optional implementation, the product of the coefficient matrix and the feature matrix can be used as the target matrix. For example, the target matrix can be calculated using the formula X3 = U1. H *X1 is obtained, where X3 represents the target matrix with dimensions [C1, M*N], U1 represents the coefficient matrix, and X1 represents the feature information after merging the dimensions of the first feature information matrix X, which can be represented as a matrix with dimensions [C, M*N]. H Let X1 be the conjugate matrix.
[0098] S505, based on the target matrix, obtain the second feature information.
[0099] As described above, the dimensions of the target matrix X3 are [C1, M*N]. In this embodiment, the dimensions of the target matrix X3 can be split into [C1, M, N]. Furthermore, the second feature information of the image to be processed can be represented by a matrix with dimensions [C1, M, N].
[0100] It is understood that since the internal structure of the second data processing layer is the same as that of the first data processing layer, the detailed process of the second data processing layer processing the second feature information of the image to be processed can be referred to S501-S505 above, and will not be repeated here in the embodiments of this application.
[0101] In this embodiment, the target dimension data in the first feature information is merged to obtain the processed feature information. Based on the processed feature information and the target dimension data, a feature matrix is obtained. The feature matrix is decomposed to obtain a coefficient matrix. Based on the coefficient matrix and the feature matrix, a target matrix is obtained. Based on the target matrix, the second feature information is obtained. Since the matrix of the first feature information is reduced in dimensionality through matrix transformation, not only can the amount of data in the first feature information be reduced, but also the feature information that best represents the classification and recognition information of each object in the image to be processed can be extracted from the first feature information. This improves the processing speed and accuracy of the classification model, and thus improves the processing efficiency of the classification model in processing the category information of each object in the image to be processed.
[0102] The above classification model can be obtained by training a pre-defined neural network model. The training process of the classification model is described in detail below. In one embodiment, such as... Figure 9 As shown, the training process of the above classification model includes:
[0103] S601, Obtain the sample image and the gold standard category information of each sample object in the sample image.
[0104] Among them, sample images refer to images used to train a preset neural network model. Each sample object in the sample image can be manually screened and labeled, and the labeled category information is used as the gold standard category information.
[0105] Optionally, in this embodiment, sample images can be acquired in real time using an image acquisition device, and the acquired images to be processed can be sent to a computer device via the image acquisition device. Alternatively, sample images can be obtained from a preset image database. Another option is to acquire a video containing sample images using the image acquisition device, and the computer device can obtain sample images by performing frame sampling on the acquired video. For example, taking commemorative coin images as an example, original commemorative coin images from different acquisition angles can be acquired using an image acquisition device. The acquired original commemorative coin images can then be manually filtered and labeled, and the labeled category information can be used as the gold standard category information for each sample object in the sample image.
[0106] As an optional implementation, the acquired image can also be subjected to data augmentation processing to obtain a data-augmented image. The acquired image and the data-augmented image can be used as sample images. The data augmentation processing can include image flipping, image translation, etc.
[0107] S602, Input the sample image into the initial classification model to obtain the sample category information of each sample object in the sample image; wherein, the initial classification model includes an initial data processing layer for dimensionality reduction of the feature information of the sample image.
[0108] The initial classification model can be a convolutional neural network model, a recurrent neural network model, or a generative adversarial network model; this embodiment does not impose any restrictions on this. The sample category information of each sample object in the sample image refers to the classification result of the identification results of each sample object based on the gold standard category information. For example, in a scenario where the sample image is a commemorative coin image, the aforementioned sample category information can include architectural, animal, floral, landscape, etc.
[0109] As an optional implementation, the initial classification model may include an initial input layer, an initial processing layer, and an initial output layer. In this embodiment, the sample image can be converted into a format that the initial classification model can process through the input layer. Then, the converted sample image is input into the bottom processing layer of the initial classification model to obtain shallow sample feature information of the sample image. The shallow sample feature information is input into the initial data processing layer, where the initial data processing layer performs data dimensionality reduction processing on the shallow sample feature information, filters out duplicate feature information, and obtains intermediate sample feature information that can maximize the representation of shallow sample feature information. The intermediate sample feature information is then input into the initial high-level processing layer of the initial classification model to obtain deep sample feature information of the sample image. Based on the deep sample feature information, the sample category information of each sample object in the sample image is obtained.
[0110] S603. Based on the gold standard category information and the sample category information of each sample object, the initial classification model is trained to obtain the classification model.
[0111] In this embodiment, for the sample image, the gold standard category information of each sample object in the sample image and the sample category information of each sample object can be compared. Based on the comparison result, the value of the loss function of the initial classification model is determined. The parameters of the initial classification model are updated based on the value of the loss function until the value of the loss function reaches a minimum or tends to stabilize, thus obtaining the classification model. The loss function can be the cross-entropy function or the squared loss function. This embodiment does not limit the loss function.
[0112] In this embodiment, by acquiring sample images and the gold standard category information of each sample object in the sample images, the sample images are input into an initial classification model that includes an initial data processing layer for dimensionality reduction of the feature information of the sample images. This allows the acquisition of sample category information of each sample object in the sample images. Furthermore, the initial classification model can be trained based on the gold standard category information and the sample category information of each sample object to obtain a classification model. Since the initial classification model can be trained based on the sample images and the gold standard category information of each sample object in the sample images, the accuracy of the obtained classification model is guaranteed to be higher, thereby improving the accuracy of the classification model in recognizing each object in the image to be processed.
[0113] The aforementioned initial classification model may include a first initial processing network and a second initial processing network. The first initial processing network may include an initial data processing layer. The training process of the first and second initial processing networks will be described in detail below. In one embodiment, such as... Figure 10 As shown, the above S602 includes:
[0114] S701, input the sample image into the first initial processing network to obtain the sample feature information after dimensionality reduction of the sample image.
[0115] The first initial processing network may include one or more initial data processing layers. These initial data processing layers reduce the dimensionality of the sample feature information output by the initial low-level processing layers in the first initial processing network. For example, if the first initial processing network includes three initial convolutional layers, an initial data processing layer may be added after each initial convolutional layer. The dimensionality reduction of each initial data processing layer reduces the dimensionality of the sample feature information output by the corresponding initial convolutional layer.
[0116] To improve the processing accuracy of the initial classification model, two initial convolutional layers and corresponding initial data processing layers can be set in the first initial processing network. In this embodiment, sample images can be sequentially input into the initial convolutional layers in the first initial processing network to obtain the initial sample feature information of the sample images, and the initial sample feature information can be input into the initial data processing layers to obtain the dimensionality-reduced sample feature information corresponding to the sample images.
[0117] S702, the dimensionality-reduced sample feature information is input into the second initial processing network to classify each sample object in the sample image and obtain the sample category information of each sample object.
[0118] The second initial processing network refers to the processing network that classifies and identifies objects in the image to be processed based on the feature information after dimensionality reduction. For example, it can be an initial classifier. Multiple initial convolutional layers and multiple initial fully connected layers can be set in the second initial processing network. For example, four initial convolutional layers can be set in the second initial processing network, namely the third initial convolutional layer, the fourth initial convolutional layer, the fifth initial convolutional layer and the sixth initial convolutional layer, and two initial fully connected layers can be set in the second initial processing network, namely the first initial fully connected layer and the second initial fully connected layer.
[0119] In this embodiment, the dimensionality-reduced sample feature information can be sequentially input into the third, fourth, fifth, and sixth initial convolutional layers in the second initial processing network to obtain the deep sample feature information of the sample image. The deep sample feature information can be the local deep sample feature information of the sample. Further, the local deep sample feature information of the sample image is sequentially input into the first and second initial fully connected layers to classify each sample object in the sample image, thereby obtaining the sample category information of each sample object.
[0120] In this embodiment, by inputting the sample image into the first initial processing network, the dimensionality-reduced sample feature information corresponding to the sample image is obtained. The dimensionality-reduced sample feature information is then input into the second initial processing network to classify each sample object in the sample image, thereby obtaining the sample category information of each sample object. Since the dimensionality reduction of the sample feature information of the sample image is performed by the first initial processing network, the amount of data input to the second initial processing network is reduced, thereby improving the processing efficiency of the initial classification model, and thus improving the accuracy of the obtained classification model, and improving the efficiency and accuracy of the classification model in recognizing each object in the image to be processed.
[0121] Taking the aforementioned first initial processing network, which includes a first initial convolutional layer, a first initial data processing layer, a second initial convolutional layer, and a second initial data processing layer, as an example, the processing procedure of the first initial processing network on the sample image is described in detail. In one embodiment, such as... Figure 11 As shown, the above S701 includes:
[0122] S801, input the sample image into the first initial convolutional layer to obtain the first sample feature information of the sample image.
[0123] The first initial convolutional layer refers to the first convolutional layer in the first initial processing network that performs convolution processing on the sample image. This first initial convolutional layer may include several initial convolutional kernels, which can be used to convolve the pixels of the sample image to obtain the first sample feature information. Optionally, the convolution processing method can be one-dimensional or two-dimensional convolution; this embodiment does not impose any limitations on this. The first sample feature information of the sample image can be edge feature information.
[0124] In this embodiment, a sample image can be input into a first initial convolutional layer. All pixels of the image to be processed are convolved by a preset initial convolutional kernel in the first initial convolutional layer to obtain pixel information after convolution. The pixel information after convolution is used as the first sample feature information of the sample image.
[0125] S802, the first sample feature information is input into the first initial data processing layer to obtain the second sample feature information corresponding to the first sample feature information; the number of channels of the second sample feature information is less than the number of channels of the first sample feature information.
[0126] The second sample feature information refers to the sample feature information obtained after dimensionality reduction of the first sample feature information. It should be noted that the initial input layer in the initial classification model can process the sample image into a sample image containing multiple channels. After the first sample convolutional layer processes the sample image with multiple channels, it will obtain a large amount of repetitive sample feature information. Therefore, the first initial data processing layer can be used to reduce the number of channels of the first sample feature information to obtain the second sample feature information with a smaller number of channels than the first sample feature information.
[0127] In this embodiment, the output of the first initial convolutional layer is connected to the input of the first initial data processing layer, so that the first sample feature information can be input into the first initial data processing layer. The first initial data processing layer can reduce the number of channels of the first sample feature information by performing matrix transformations on the first sample feature information, thereby obtaining the second sample feature information.
[0128] S803, the second sample feature information is input into the second initial convolutional layer to obtain the third sample feature information corresponding to the second sample feature information; the feature quantity of the third sample feature information is less than the feature quantity of the second sample feature information.
[0129] Here, the second initial convolutional layer refers to the second initial convolutional layer in the first initial processing network that performs convolution processing on the sample image. The output of the first initial data processing layer is connected to the input of the second initial convolutional layer. The third sample feature information refers to the output of the second initial convolutional layer, which may include deep feature information of local images including regions of interest in the sample image. It can be understood that the second initial convolutional layer performs further feature extraction processing on the second sample feature information; therefore, the feature quantity of the resulting third sample feature information is less than that of the second sample feature information.
[0130] In this embodiment, the second sample feature information output from the first initial data processing layer can be input into the second initial convolutional layer. The second sample feature information is then convolved by a preset initial convolutional kernel in the second initial convolutional layer, and the pixel information after convolution is used as the third sample feature information of the sample image.
[0131] S804, input the third sample feature information into the second initial data processing layer to obtain the dimensionality-reduced sample feature information; the number of channels of the dimensionality-reduced sample feature information is less than the number of channels of the third sample feature information.
[0132] The internal structure of the second initial data processing layer can be the same as that of the first initial data processing layer. The second initial data processing layer can be used to reduce the dimensionality of the third sample feature information, so as to obtain the dimensionality-reduced sample feature information with a smaller number of channels than the third sample feature information.
[0133] In this embodiment, the output of the second initial convolutional layer is connected to the input of the second initial data processing layer, so that the third sample feature information can be input into the second initial data processing layer. The second initial data processing layer can reduce the number of channels of the second sample feature information by performing matrix transformation on the second sample feature information, thereby obtaining the sample feature information after dimensionality reduction.
[0134] In this embodiment, by inputting the sample image into the first initial convolutional layer, the first sample feature information of the sample image is obtained. The first sample feature information is then input into the first initial data processing layer to obtain the second sample feature information, which has a smaller number of channels than the first sample feature information. The second sample feature information is then input into the second initial convolutional layer to obtain the third sample feature information, which has a smaller number of features than the second sample feature information. The third sample feature information is then input into the second initial data processing layer to obtain the channel number sample feature information, which has a smaller number of channels than the third sample feature information after dimensionality reduction. Since the first sample feature information is dimensionality reduced by the first initial data processing layer and the second sample feature information is dimensionality reduced by the second initial data processing layer, the dimensionality-reduced sample feature information obtained by the first initial processing network includes the feature information that maximizes the representation of the sample image. This improves the accuracy of the classification model trained by the first initial processing network, and thus improves the accuracy of the classification model in classifying and recognizing objects in the image to be processed.
[0135] To facilitate understanding by those skilled in the art, the image processing method provided in this application will be described in detail below. This method may include:
[0136] S1, Obtain the original image.
[0137] S2, perform data augmentation on the original image to obtain the data-augmented original image, and use the original image and the data-augmented original image as sample images.
[0138] S3, label each sample object in the sample image to obtain the gold standard category information of each sample object in the sample image.
[0139] S4, input the sample image into the initial classification model to obtain the sample category information of each sample object in the sample image; wherein, the initial classification model includes a first initial processing network and a second initial processing network, the first initial processing network includes a first initial convolutional layer, a first initial data processing layer, a second initial convolutional layer, and a second initial data processing layer, the above-mentioned inputting the sample image into the initial classification model to obtain the sample category information of each sample object in the sample image includes: inputting the sample image into the first initial convolutional layer to obtain the first sample feature information of the sample image; inputting the first sample feature information into the first initial data processing layer to obtain the second sample feature information corresponding to the first sample feature information. The second sample feature information has fewer channels than the first sample feature information. The second sample feature information is input into the second initial convolutional layer to obtain the third sample feature information corresponding to the second sample feature information. The feature quantity of the third sample feature information is less than the feature quantity of the second sample feature information. The third sample feature information is input into the second initial data processing layer to obtain the dimensionality-reduced sample feature information. The number of channels of the dimensionality-reduced sample feature information is less than the number of channels of the third sample feature information. The dimensionality-reduced sample feature information is input into the second initial processing network to classify each sample object in the sample image and obtain the sample category information of each sample object.
[0140] S5. Based on the gold standard category information and the sample category information of each sample object, the initial classification model is trained to obtain the classification model.
[0141] S6, Obtain the image to be processed.
[0142] S7, the image to be processed is input into a preset classification model to obtain the category information of each object in the image to be processed. The classification model further includes a first processing network and a second processing network. The first processing network includes a first convolutional layer, a first data processing layer, a second convolutional layer, and a second data processing layer. The process of inputting the image to be processed into the preset classification model to obtain the category information of each object in the image to be processed includes: inputting the image to be processed into the first convolutional layer of the second initial convolutional layer to obtain the first feature information of the image to be processed in the second initial convolutional layer; inputting the first feature information of the second initial convolutional layer into the first data processing layer of the second initial convolutional layer to obtain the second feature information corresponding to the first feature information of the second initial convolutional layer; the number of channels of the second feature information of the second initial convolutional layer is less than that of the first data processing layer of the second initial convolutional layer. The number of channels for the first initial convolutional layer is determined. The second initial convolutional layer's second feature information is input into the second initial convolutional layer to obtain the third feature information corresponding to the second initial convolutional layer's second feature information. The feature quantity of the third feature information of the second initial convolutional layer is less than the feature quantity of the second initial convolutional layer's second feature information. The third feature information of the second initial convolutional layer is input into the second data processing layer of the second initial convolutional layer to obtain the feature information after dimensionality reduction. The number of channels for the feature information after dimensionality reduction is less than the number of channels for the third feature information of the second initial convolutional layer. The feature information after dimensionality reduction is input into the second processing network of the second initial convolutional layer to classify each object in the image to be processed by the second initial convolutional layer, obtaining the category information of each object in the second initial convolutional layer.
[0143] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0144] Based on the same inventive concept, this application also provides an image processing apparatus for implementing the image processing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more image processing apparatus embodiments provided below can be found in the limitations of the image processing method described above, and will not be repeated here.
[0145] In one embodiment, such as Figure 12 As shown, an image processing apparatus is provided, comprising: a first acquisition module 10 and a second acquisition module 11, wherein:
[0146] The first acquisition module 10 is used to acquire the image to be processed.
[0147] The second acquisition module 11 is used to input the image to be processed into a preset classification model to obtain the category information of each object in the image to be processed; wherein, the classification model includes a data processing layer for dimensionality reduction processing of the feature information of the image to be processed.
[0148] The image processing apparatus provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0149] In one embodiment, the classification model further includes a first processing network and a second processing network; the first processing network includes a data processing layer, such as... Figure 13 As shown, the second acquisition module 11 includes: a first acquisition unit 111 and a second acquisition unit 112, wherein:
[0150] The first acquisition unit 111 is used to input the image to be processed into the first processing network and acquire the feature information of the image after dimensionality reduction.
[0151] The second acquisition unit 112 is used to input the feature information after dimensionality reduction into the second processing network to classify each object in the image to be processed and obtain the category information of each object.
[0152] The image processing apparatus provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0153] In one embodiment, the first processing network includes a first convolutional layer, a first data processing layer, a second convolutional layer, and a second data processing layer. Please refer to... Figure 13 The aforementioned first acquisition unit 111 includes: a first acquisition subunit 1111, a second acquisition subunit 1112, a third acquisition subunit 1113, and a fourth acquisition subunit 1114, wherein:
[0154] The first acquisition subunit 1111 is used to input the image to be processed into the first convolutional layer to obtain the first feature information of the image to be processed.
[0155] The second acquisition subunit 1112 is used to input the first feature information into the first data processing layer to obtain the second feature information corresponding to the first feature information; the number of channels of the second feature information is less than the number of channels of the first feature information.
[0156] The third acquisition subunit 1113 is used to input the second feature information into the second convolutional layer to obtain the third feature information corresponding to the second feature information; the feature quantity of the third feature information is less than the feature quantity of the second feature information.
[0157] The fourth acquisition subunit 1114 is used to input the third feature information into the second data processing layer to obtain the feature information after dimensionality reduction; the number of channels of the feature information after dimensionality reduction is less than the number of channels of the third feature information.
[0158] The image processing apparatus provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0159] In one embodiment, please continue to refer to Figure 13 The aforementioned second acquisition subunit 1112 is specifically used to merge the data of the target dimension in the first feature information to obtain the processed feature information; to obtain the feature matrix based on the processed feature information and the data of the target dimension; the feature matrix represents the matrix after dimensional transformation of the first feature information; to decompose the feature matrix to obtain the coefficient matrix; the coefficient matrix represents the matrix composed of the vectors from the first column to the Nth column of the feature matrix; to obtain the target matrix based on the coefficient matrix and the feature matrix; and to obtain the second feature information based on the target matrix.
[0160] The image processing apparatus provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0161] In one embodiment, please continue to refer to Figure 13 The training process of the above classification model includes: a third acquisition module 12, a fourth acquisition module 13, and a fifth acquisition module 14, wherein:
[0162] The third acquisition module 12 is used to acquire sample images and gold standard category information of each sample object in the sample images.
[0163] The fourth acquisition module 13 is used to input the sample image into the initial classification model to obtain the sample category information of each sample object in the sample image; wherein, the initial classification model includes an initial data processing layer for dimensionality reduction processing of the feature information of the sample image.
[0164] The fifth acquisition module 14 is used to train the initial classification model based on the gold standard category information and the sample category information of each sample object to obtain the classification model.
[0165] The image processing apparatus provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0166] In one embodiment, the initial classification model further includes a first initial processing network and a second initial processing network; the first initial processing network includes an initial data processing layer; please refer to... Figure 13 The aforementioned fourth acquisition module 13 includes: a third acquisition unit 131 and a fourth acquisition unit 132, wherein:
[0167] The third acquisition unit 131 is used to input the sample image into the first initial processing network and acquire the sample feature information after dimensionality reduction of the sample image.
[0168] The fourth acquisition unit 132 is used to input the dimensionality-reduced sample feature information into the second initial processing network to classify each sample object in the sample image and obtain the sample category information of each sample object.
[0169] The image processing apparatus provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0170] In one embodiment, the first initial processing network includes a first initial convolutional layer, a first initial data processing layer, a second initial convolutional layer, and a second initial data processing layer; please continue to refer to... Figure 13 The aforementioned third acquisition unit 131 is specifically used to input the sample image into the first initial convolutional layer to obtain the first sample feature information of the sample image; input the first sample feature information into the first initial data processing layer to obtain the second sample feature information corresponding to the first sample feature information; the number of channels of the second sample feature information is less than the number of channels of the first sample feature information; input the second sample feature information into the second initial convolutional layer to obtain the third sample feature information corresponding to the second sample feature information; the feature quantity of the third sample feature information is less than the feature quantity of the second sample feature information; input the third sample feature information into the second initial data processing layer to obtain the dimension-reduced sample feature information; the number of channels of the dimension-reduced sample feature information is less than the number of channels of the third sample feature information.
[0171] The image processing apparatus provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0172] Each module in the aforementioned image processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0173] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0174] Obtain the image to be processed;
[0175] The image to be processed is input into a preset classification model to obtain the category information of each object in the image; wherein, the classification model includes a data processing layer for dimensionality reduction of the feature information of the image to be processed.
[0176] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0177] The image to be processed is input into the first processing network to obtain the feature information of the image after dimensionality reduction.
[0178] The dimensionality-reduced feature information is input into the second processing network to classify the objects in the image to be processed, thereby obtaining the category information of each object.
[0179] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0180] The image to be processed is input into the first convolutional layer to obtain the first feature information of the image to be processed;
[0181] The first feature information is input into the first data processing layer to obtain the second feature information corresponding to the first feature information; the number of channels of the second feature information is less than the number of channels of the first feature information.
[0182] The second feature information is input into the second convolutional layer to obtain the third feature information corresponding to the second feature information; the feature quantity of the third feature information is less than the feature quantity of the second feature information.
[0183] The third feature information is input into the second data processing layer to obtain the feature information after dimensionality reduction; the number of channels of the feature information after dimensionality reduction is less than the number of channels of the third feature information.
[0184] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0185] The data of the target dimension in the first feature information are merged to obtain the processed feature information;
[0186] Based on the processed feature information and the target dimension data, a feature matrix is obtained; the feature matrix represents the matrix after dimensional transformation of the first feature information.
[0187] The feature matrix is decomposed to obtain the coefficient matrix; the coefficient matrix represents the matrix composed of the vectors from the first column to the Nth column of the feature matrix.
[0188] The target matrix is obtained based on the coefficient matrix and the characteristic matrix;
[0189] Based on the target matrix, the second feature information is obtained.
[0190] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0191] Obtain sample images and gold standard category information for each sample object in the sample images;
[0192] The sample image is input into the initial classification model to obtain the sample category information of each sample object in the sample image; the initial classification model includes an initial data processing layer for dimensionality reduction of the feature information of the sample image;
[0193] Based on the gold standard category information and the sample category information of each sample object, the initial classification model is trained to obtain the classification model.
[0194] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0195] Input the sample image into the first initial processing network to obtain the sample feature information after dimensionality reduction of the sample image;
[0196] The dimensionality-reduced sample feature information is input into the second initial processing network to classify each sample object in the sample image and obtain the sample category information of each sample object.
[0197] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0198] The sample image is input into the first initial convolutional layer to obtain the first sample feature information of the sample image;
[0199] The first sample feature information is input into the first initial data processing layer to obtain the second sample feature information corresponding to the first sample feature information; the number of channels of the second sample feature information is less than the number of channels of the first sample feature information.
[0200] The second sample feature information is input into the second initial convolutional layer to obtain the third sample feature information corresponding to the second sample feature information; the feature quantity of the third sample feature information is less than the feature quantity of the second sample feature information.
[0201] The third sample feature information is input into the second initial data processing layer to obtain the dimensionality-reduced sample feature information; the number of channels in the dimensionality-reduced sample feature information is less than the number of channels in the third sample feature information.
[0202] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0203] Obtain the image to be processed;
[0204] The image to be processed is input into a preset classification model to obtain the category information of each object in the image; wherein, the classification model includes a data processing layer for dimensionality reduction of the feature information of the image to be processed.
[0205] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0206] The image to be processed is input into the first processing network to obtain the feature information of the image after dimensionality reduction.
[0207] The dimensionality-reduced feature information is input into the second processing network to classify the objects in the image to be processed, thereby obtaining the category information of each object.
[0208] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0209] The image to be processed is input into the first convolutional layer to obtain the first feature information of the image to be processed;
[0210] The first feature information is input into the first data processing layer to obtain the second feature information corresponding to the first feature information; the number of channels of the second feature information is less than the number of channels of the first feature information.
[0211] The second feature information is input into the second convolutional layer to obtain the third feature information corresponding to the second feature information; the feature quantity of the third feature information is less than the feature quantity of the second feature information.
[0212] The third feature information is input into the second data processing layer to obtain the feature information after dimensionality reduction; the number of channels of the feature information after dimensionality reduction is less than the number of channels of the third feature information.
[0213] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0214] The data of the target dimension in the first feature information are merged to obtain the processed feature information;
[0215] Based on the processed feature information and the target dimension data, a feature matrix is obtained; the feature matrix represents the matrix after dimensional transformation of the first feature information.
[0216] The feature matrix is decomposed to obtain the coefficient matrix; the coefficient matrix represents the matrix composed of the vectors from the first column to the Nth column of the feature matrix.
[0217] The target matrix is obtained based on the coefficient matrix and the characteristic matrix;
[0218] Based on the target matrix, the second feature information is obtained.
[0219] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0220] Obtain sample images and gold standard category information for each sample object in the sample images;
[0221] The sample image is input into the initial classification model to obtain the sample category information of each sample object in the sample image; the initial classification model includes an initial data processing layer for dimensionality reduction of the feature information of the sample image;
[0222] Based on the gold standard category information and the sample category information of each sample object, the initial classification model is trained to obtain the classification model.
[0223] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0224] Input the sample image into the first initial processing network to obtain the sample feature information after dimensionality reduction of the sample image;
[0225] The dimensionality-reduced sample feature information is input into the second initial processing network to classify each sample object in the sample image and obtain the sample category information of each sample object.
[0226] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0227] The sample image is input into the first initial convolutional layer to obtain the first sample feature information of the sample image;
[0228] The first sample feature information is input into the first initial data processing layer to obtain the second sample feature information corresponding to the first sample feature information; the number of channels of the second sample feature information is less than the number of channels of the first sample feature information.
[0229] The second sample feature information is input into the second initial convolutional layer to obtain the third sample feature information corresponding to the second sample feature information; the feature quantity of the third sample feature information is less than the feature quantity of the second sample feature information.
[0230] The third sample feature information is input into the second initial data processing layer to obtain the dimensionality-reduced sample feature information; the number of channels in the dimensionality-reduced sample feature information is less than the number of channels in the third sample feature information.
[0231] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0232] Obtain the image to be processed;
[0233] The image to be processed is input into a preset classification model to obtain the category information of each object in the image; wherein, the classification model includes a data processing layer for dimensionality reduction of the feature information of the image to be processed.
[0234] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0235] The image to be processed is input into the first processing network to obtain the feature information of the image after dimensionality reduction.
[0236] The dimensionality-reduced feature information is input into the second processing network to classify the objects in the image to be processed, thereby obtaining the category information of each object.
[0237] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0238] The image to be processed is input into the first convolutional layer to obtain the first feature information of the image to be processed;
[0239] The first feature information is input into the first data processing layer to obtain the second feature information corresponding to the first feature information; the number of channels of the second feature information is less than the number of channels of the first feature information.
[0240] The second feature information is input into the second convolutional layer to obtain the third feature information corresponding to the second feature information; the feature quantity of the third feature information is less than the feature quantity of the second feature information.
[0241] The third feature information is input into the second data processing layer to obtain the feature information after dimensionality reduction; the number of channels of the feature information after dimensionality reduction is less than the number of channels of the third feature information.
[0242] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: merging the data of the target dimension in the first feature information to obtain the processed feature information;
[0243] Based on the processed feature information and the target dimension data, a feature matrix is obtained; the feature matrix represents the matrix after dimensional transformation of the first feature information.
[0244] The feature matrix is decomposed to obtain the coefficient matrix; the coefficient matrix represents the matrix composed of the vectors from the first column to the Nth column of the feature matrix.
[0245] The target matrix is obtained based on the coefficient matrix and the characteristic matrix;
[0246] Based on the target matrix, the second feature information is obtained.
[0247] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0248] Obtain sample images and gold standard category information for each sample object in the sample images;
[0249] The sample image is input into the initial classification model to obtain the sample category information of each sample object in the sample image; the initial classification model includes an initial data processing layer for dimensionality reduction of the feature information of the sample image;
[0250] Based on the gold standard category information and the sample category information of each sample object, the initial classification model is trained to obtain the classification model.
[0251] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0252] Input the sample image into the first initial processing network to obtain the sample feature information after dimensionality reduction of the sample image;
[0253] The dimensionality-reduced sample feature information is input into the second initial processing network to classify each sample object in the sample image and obtain the sample category information of each sample object.
[0254] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0255] The sample image is input into the first initial convolutional layer to obtain the first sample feature information of the sample image;
[0256] The first sample feature information is input into the first initial data processing layer to obtain the second sample feature information corresponding to the first sample feature information; the number of channels of the second sample feature information is less than the number of channels of the first sample feature information.
[0257] The second sample feature information is input into the second initial convolutional layer to obtain the third sample feature information corresponding to the second sample feature information; the feature quantity of the third sample feature information is less than the feature quantity of the second sample feature information.
[0258] The third sample feature information is input into the second initial data processing layer to obtain the dimensionality-reduced sample feature information; the number of channels in the dimensionality-reduced sample feature information is less than the number of channels in the third sample feature information.
[0259] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0260] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0261] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0262] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. An image processing method, characterized in that, The method includes: Obtain the image to be processed; The image to be processed is input into a preset classification model to obtain the category information of each object in the image to be processed; wherein, the classification model includes a data processing layer for dimensionality reduction of the feature information of the image to be processed; The data processing layer is specifically used for: The horizontal and vertical pixel counts in the feature information of the input image to be processed are merged to obtain the processed feature information. Based on the processed feature information and the product of the horizontal pixel count and the vertical pixel count, a feature matrix is obtained; The feature matrix is decomposed to obtain a first matrix, and all elements of the first preset number of column vectors of the first matrix are used as a coefficient matrix; the first matrix is used to maximize the representation of the feature information of the image to be processed, and the preset number is less than the number of column vectors of the first matrix; Based on the coefficient matrix and the processed feature information, a target matrix is obtained. The target matrix is then dimensionally split to obtain dimensionality-reduced feature information, wherein the number of channels in the dimensionality-reduced feature information is less than the number of channels in the feature information.
2. The method of claim 1, wherein, The classification model further includes a first processing network and a second processing network; the first processing network includes the data processing layer; the step of inputting the image to be processed into the preset classification model to obtain the category information of each object in the image to be processed includes: The image to be processed is input into the first processing network to obtain the dimension-reduced feature information corresponding to the image to be processed. The feature information after dimensionality reduction is input into the second processing network to classify each object in the image to be processed, thereby obtaining the category information of each object.
3. The method of claim 2, wherein, The first processing network includes a first convolutional layer, a first data processing layer, a second convolutional layer, and a second data processing layer; the step of inputting the image to be processed into the first processing network to obtain the dimensionality-reduced feature information corresponding to the image to be processed includes: The image to be processed is input into the first convolutional layer to obtain the first feature information of the image to be processed; The first feature information is input into the first data processing layer to obtain the second feature information corresponding to the first feature information; the number of channels of the second feature information is less than the number of channels of the first feature information. The second feature information is input into the second convolutional layer to obtain the third feature information corresponding to the second feature information; the feature quantity of the third feature information is less than the feature quantity of the second feature information. The third feature information is input into the second data processing layer to obtain the feature information after dimensionality reduction; the number of channels of the feature information after dimensionality reduction is less than the number of channels of the third feature information.
4. The method according to any one of claims 1 to 3, characterized in that, The training process of the classification model includes: Obtain sample images and gold standard category information for each sample object in the sample images; The sample image is input into an initial classification model to obtain sample category information for each sample object in the sample image; wherein, the initial classification model includes an initial data processing layer for dimensionality reduction of the feature information of the sample image; The initial classification model is trained based on the gold standard category information and the sample category information of each sample object to obtain the classification model.
5. The method according to claim 4, characterized in that, The initial classification model further includes a first initial processing network and a second initial processing network; the first initial processing network includes the initial data processing layer; the step of inputting the sample image into the initial classification model to obtain the sample category information corresponding to each sample object in the sample image includes: The sample image is input into the first initial processing network to obtain the dimensionality-reduced sample feature information corresponding to the sample image; The dimensionality-reduced sample feature information is input into the second initial processing network to classify each sample object in the sample image, thereby obtaining the sample category information of each sample object.
6. The method according to claim 5, characterized in that, The first initial processing network includes a first initial convolutional layer, a first initial data processing layer, a second initial convolutional layer, and a second initial data processing layer; the step of inputting the sample image into the first initial processing network to obtain the dimensionality-reduced sample feature information corresponding to the sample image includes: The sample image is input into the first initial convolutional layer to obtain the first sample feature information of the sample image; The first sample feature information is input into the first initial data processing layer to obtain the second sample feature information corresponding to the first sample feature information; the number of channels of the second sample feature information is less than the number of channels of the first sample feature information. The second sample feature information is input into the second initial convolutional layer to obtain the third sample feature information corresponding to the second sample feature information; the feature quantity of the third sample feature information is less than the feature quantity of the second sample feature information. The third sample feature information is input into the second initial data processing layer to obtain the dimensionality-reduced sample feature information; the number of channels in the dimensionality-reduced sample feature information is less than the number of channels in the third sample feature information.
7. An image processing apparatus, characterized in that, The device includes: The first acquisition module is used to acquire the image to be processed; The second acquisition module is used to input the image to be processed into a preset classification model to acquire the category information of each object in the image to be processed; wherein, the classification model includes a data processing layer for dimensionality reduction processing of the feature information of the image to be processed; The data processing layer is specifically used for: The horizontal and vertical pixel counts in the feature information of the input image to be processed are merged to obtain the processed feature information. Based on the processed feature information and the product of the horizontal pixel count and the vertical pixel count, a feature matrix is obtained; The feature matrix is decomposed to obtain a first matrix, and all elements of the first preset number of column vectors of the first matrix are used as a coefficient matrix; the first matrix is used to maximize the representation of the feature information of the image to be processed, and the preset number is less than the number of column vectors of the first matrix; Based on the coefficient matrix and the processed feature information, a target matrix is obtained. The target matrix is then dimensionally split to obtain dimensionality-reduced feature information, wherein the number of channels in the dimensionality-reduced feature information is less than the number of channels in the feature information.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Non-negative image data dimension reduction method based on Hessian regular constraint and A optimization
CN104951651A
Hyperspectral image classification method based on convolutional neural network
CN111985575A
Unsupervised feature selection method and system based on multi-source remote sensing data
CN115795395A