Artificial intelligence-based picture compression method, device, equipment and medium

CN117376486BActive Publication Date: 2026-10-16SHENZHEN COOCAA NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311181546.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-13
Publication Date
2026-10-16
Estimated Expiration
2043-09-13

AI Technical Summary

Technical Problem

[0004]基于此,本申请实施例提供了一种基于人工智能的图片压缩方法、装置、计算机设备及存储介质,以解决目前的图像压缩方法存在较大信息损失的问题

Benefits of technology

[0018] The image compression method, apparatus, device, and medium based on artificial intelligence of this application first acquire the target image to be processed, input the target image to be processed into a pre-trained neural network model to obtain several image feature vectors of the target image, process the several image feature vectors using a preset potential energy function to obtain a first compressed image feature vector, store the first compressed image feature vector to obtain a second compressed image feature vector, and perform decompression and reconstruction processing on the second compressed image feature vector to obtain the decompressed and reconstructed image of the target image. The image compression method of this application can compress images efficiently, not only achieving a higher compression ratio while preserving image details, but also reducing information loss during compression to ensure image quality, provide users with a better compression and transmission experience, and meet users' needs for high-quality images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117376486B_ABST
    Figure CN117376486B_ABST
Patent Text Reader

Abstract

The application discloses an artificial intelligence-based picture compression method and device, computer equipment and a storage medium. The artificial intelligence-based picture compression method is characterized in that: firstly, a target picture to be processed is obtained, and the target picture to be processed is input into a neural network model that has been trained, so as to obtain a plurality of image feature vectors of the target picture; a preset potential function is used to process the plurality of image feature vectors, so as to obtain a first compressed image feature vector; the first compressed image feature vector is stored, so as to obtain a second compressed image feature vector; and the second compressed image feature vector is decompressed and reconstructed, so as to obtain a decompressed and reconstructed image of the target picture. The picture compression method can efficiently compress an image, can not only achieve a higher compression ratio while retaining the details of the image, but also can reduce information loss during compression, so as to ensure the image quality and meet the demand of users for high-quality images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image compression technology, and in particular to an image compression method, apparatus, computer device, and storage medium based on artificial intelligence. Background Technology

[0002] With the advent of the information age, the amount of data has exploded. In daily life, data compression is often necessary when storing and transmitting various types of data. Image compression is a technique that represents the original pixel matrix with lossy or lossless representation using fewer bits. However, traditional image compression methods based on Huffman coding and Discrete Cosine Transform (DCT) suffer from drawbacks such as high information loss and low compression ratios, failing to adequately meet user needs.

[0003] Therefore, how to achieve a higher compression ratio while preserving image details, reducing information loss during compression, and ensuring image quality has become an urgent problem to be solved. Summary of the Invention

[0004] Based on this, embodiments of this application provide an image compression method, apparatus, computer device, and storage medium based on artificial intelligence to solve the problem of significant information loss in current image compression methods.

[0005] In a first aspect, embodiments of this application provide an image compression method based on artificial intelligence, comprising:

[0006] The target image to be processed is obtained, and the target image is input into a pre-trained image feature neural network model to obtain several image feature vectors of the target image;

[0007] The image feature vectors are quantized using a preset potential energy function to obtain the first compressed image feature vector of each feature image.

[0008] The first compressed image feature vector of each of the feature images is stored using a preset image storage format to obtain the second compressed image feature vector of each of the feature images;

[0009] The second compressed image feature vectors of each of the aforementioned feature images are subjected to image decompression and reconstruction processing to obtain the decompressed and reconstructed image of the target image.

[0010] Secondly, embodiments of this application provide an image compression device based on artificial intelligence, comprising:

[0011] The image feature vector acquisition module is used to acquire the target image to be processed, input the target image into a pre-trained image feature neural network model, and obtain several image feature vectors of the target image.

[0012] The first compressed image feature vector extraction module is used to quantize each of the image feature vectors using a preset potential energy function to obtain the first compressed image feature vector of each of the feature images.

[0013] The second compressed image feature vector extraction module is used to store the first compressed image feature vector of each of the feature images using a preset image storage format, so as to obtain the second compressed image feature vector of each of the feature images.

[0014] The decompression and reconstruction image module is used to perform image decompression and reconstruction processing on the second compressed image feature vectors of each of the feature images to obtain the decompressed and reconstructed image of the target image.

[0015] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the artificial intelligence-based image compression method as described in the first aspect above.

[0016] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of an artificial intelligence-based image compression method.

[0017] The advantages of the embodiments in this application compared to the prior art are:

[0018] The image compression method, apparatus, device, and medium based on artificial intelligence of this application first acquire the target image to be processed, input the target image to be processed into a pre-trained neural network model to obtain several image feature vectors of the target image, process the several image feature vectors using a preset potential energy function to obtain a first compressed image feature vector, store the first compressed image feature vector to obtain a second compressed image feature vector, and perform decompression and reconstruction processing on the second compressed image feature vector to obtain the decompressed and reconstructed image of the target image. The image compression method of this application can compress images efficiently, not only achieving a higher compression ratio while preserving image details, but also reducing information loss during compression to ensure image quality, provide users with a better compression and transmission experience, and meet users' needs for high-quality images. Attached Figure Description

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

[0020] Figure 1 This is a schematic diagram of an application environment for an image compression method based on artificial intelligence provided in an embodiment of this application;

[0021] Figure 2 This is a schematic flowchart of an image compression method based on artificial intelligence provided in an embodiment of this application;

[0022] Figure 3 This is a schematic flowchart of an image compression method based on artificial intelligence provided in an embodiment of this application;

[0023] Figure 4 This is a schematic diagram of the structure of an image compression device based on artificial intelligence provided in an embodiment of this application; Detailed Implementation

[0024] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0025] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0026] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0027] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0028] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0029] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0030] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0031] To illustrate the technical solution of this application, specific embodiments are described below.

[0032] This application provides an embodiment of an artificial intelligence-based image compression method, which can be applied to applications such as... Figure 1 In specific application environments, the AI-based image compression method of this application is applied in a computer system, which includes, for example, […]. Figure 1 The diagram illustrates a client and server. The client communicates with the server over a network. The client, also known as the user terminal, is the program that provides local services to the client, corresponding to the server. Clients can be installed on, but are not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0033] See Figure 2This is a flowchart illustrating an AI-based image compression method according to this application. The aforementioned AI-based image compression method is applied to... Figure 1 The server in the middle.

[0034] In one embodiment, such as Figure 2 As shown, the AI-based image compression method may include the following steps:

[0035] Step S21: Obtain the target image to be processed, input the target image into the trained image feature neural network model, and obtain several image feature vectors of the target image;

[0036] Specifically, an image feature vector is a vector representing image features extracted from a trained image feature neural network model. Image feature vectors are used to describe key information and features of an image, and can include information such as the image's color, shape, and texture.

[0037] Image feature neural network models are a type of deep learning model used for computer vision tasks. These models are primarily used to extract features from images for subsequent tasks such as classification, detection, and segmentation. Common image feature neural network models include ResNet, VGG, and other deep convolutional neural network models. These models are highly efficient at extracting image features and are widely used in computer vision tasks, achieving significant results.

[0038] For example, ResNet (Residual Network) is a deep convolutional neural network architecture that addresses the vanishing and exploding gradient problems during deep network training by introducing residual connections. In traditional convolutional neural networks, network layers are directly mapped to each other. However, in ResNet, each network layer receives not only the input from the previous layer but also the input from a residual connection—the difference between the previous layer's input and output. This allows the network layer's output to be obtained by fine-tuning the input of the residual connection, rather than directly from the previous layer's input. This method of introducing residual connections enables the network to learn residual functions, thus better adapting to the data and optimizing the network. The core idea of ​​ResNet is to build deep networks through residual connections, enabling the network to better learn the details and features of the data. By introducing residual connections, ResNet can build very deep networks without encountering the vanishing and exploding gradient problems. This has enabled ResNet to achieve outstanding results in computer vision tasks such as image classification, object detection, and semantic segmentation.

[0039] The VGG model is a classic deep convolutional neural network model. Its core idea is to construct a deep network by stacking multiple convolutional and pooling layers. The main characteristic of the VGG model is the use of multiple consecutive convolutional layers, each using a 3×3 kernel and the ReLU activation function. This small kernel size not only increases the model's non-linear representation capability but also reduces the number of parameters. After each convolutional layer, the VGG model uses a 2×2 max-pooling layer to reduce the size of the feature maps and extract more abstract features. The VGG model has a very simple and regular structure, consisting of multiple convolutional blocks. Each convolutional block consists of consecutive convolutional and pooling layers, with the number of channels gradually increasing. By stacking multiple convolutional blocks, the VGG model can learn more complex and abstract features. In image classification tasks, the VGG model demonstrates excellent performance. Compared to other models, the VGG model has a relatively simple structure but performs exceptionally well in image classification tasks.

[0040] Step S22: Quantize each of the image feature vectors using a preset potential energy function to obtain the first compressed image feature vector of each of the feature images;

[0041] Specifically, the preset potential function refers to the use of a predefined potential function to adaptively quantize the image feature vectors during image feature vector processing, thereby determining the image feature vectors that need to be compressed. After adaptively quantizing each image feature vector using the preset potential function, compression is achieved by reducing the precision of each vector value in the image feature vector, so that each feature image can obtain its corresponding first compressed image feature vector.

[0042] Step S23: Store the first compressed image feature vector of each of the feature images using a preset image storage format to obtain the second compressed image feature vector of each of the feature images.

[0043] Specifically, when compressing the image feature vectors, the first compressed image feature vectors of each feature image are compressed and stored using a preset image storage format. After the first compressed image feature vectors of each feature image are stored, the second compressed image feature vectors of each feature image can be obtained.

[0044] For example, assuming the default image storage format is JPEG, storing the first compressed feature vector of each feature image using the JPEG format mainly includes the following steps:

[0045] Color space conversion is performed on the first compressed image feature vector of each feature image to obtain three 8×8 first compressed image feature matrices of the first compressed image feature vector;

[0046] A two-dimensional discrete cosine transform is performed on the three 8×8 first compressed image feature matrices of the first compressed image feature vector to obtain the floating-point matrix of the first compressed image feature vector.

[0047] The floating-point matrix of the first compressed image feature vector is quantized to obtain a one-dimensional array of the first compressed image feature vector;

[0048] Huffman compression is performed on the one-dimensional array of the first compressed image feature vector to obtain the second compressed image feature vector.

[0049] Step S24: Perform image decompression and reconstruction processing on the second compressed image feature vectors of each of the feature images to obtain the decompressed and reconstructed image of the target image.

[0050] Specifically, the decompression and reconstruction process involves reconstructing all feature vectors of the second compressed image. After this process, a decompressed and reconstructed image of the target image is obtained, resulting in a high-quality compressed image while maintaining image quality.

[0051] The image compression method based on artificial intelligence in this application first acquires the target image to be processed, inputs the target image into a pre-trained neural network model to obtain several image feature vectors of the target image, processes the several image feature vectors using a preset potential function to obtain a first compressed image feature vector, stores the first compressed image feature vector to obtain a second compressed image feature vector, and performs decompression and reconstruction processing on the second compressed image feature vector to obtain the decompressed and reconstructed image of the target image. The image compression method of this application can compress images efficiently, not only achieving a higher compression ratio while preserving image details, but also reducing information loss during compression to ensure image quality, providing users with a better compression and transmission experience, and meeting users' needs for high-quality images.

[0052] In one embodiment, such as Figure 3 As shown, in step S22, a preset potential energy function is used to quantize each of the image feature vectors to obtain the first compressed image feature vector of each feature image. This may include the following steps:

[0053] Step S31: Calculate the potential energy value of each image feature vector according to the preset potential energy function;

[0054] The expression for the preset potential energy function is as follows:

[0055]

[0056] Wherein, E(x) i Let x be the potential energy function.i Let be the i-th feature vector, and α be the regularization coefficient, which is generally set to 1 by default. In practical applications, the value of α can be adjusted according to experimental data to make the classification effect more accurate. Usually, α can take values ​​in the range of [0,1] or [0,10].

[0057] For example, suppose there are the following four image feature vectors:

[0058] [0.1, 0.5, 0.3, 0.2]

[0059] [0.7,0.4,0.9,0.2]

[0060] [0.8, 0.6, 0.5, 0.9]

[0061] [0.2,0.4,0.1,0.3]

[0062] The potential energy value is calculated using a preset potential energy function formula:

[0063] For the first eigenvector [0.1, 0.5, 0.3, 0.2], its potential energy value is E(x1) = 0.6978;

[0064] For the second eigenvector [0.7, 0.4, 0.9, 0.2], its potential energy value is E(x2) = 0.9783;

[0065] For the third eigenvector [0.8, 0.6, 0.5, 0.9], its potential energy value is E(x3) = 0.9724;

[0066] For the fourth eigenvector [0.2, 0.4, 0.1, 0.3], its potential energy value is E(x4) = 0.3571.

[0067] Step S32: Compare the potential energy value of each of the image feature vectors with a preset compression potential energy threshold.

[0068] Specifically, by setting a preset compression potential energy threshold, the potential energy value of each image feature vector can be compared with the preset compression potential energy threshold. The preset compression potential energy threshold is 0.5. Based on the comparison result, the feature vectors can be divided into those that need to be compressed and those that do not need to be compressed. The compression potential energy threshold can be set according to the specific usage.

[0069] For the first eigenvector, E(x1) = 0.6978. After comparing this value with the preset compression potential energy threshold, the potential energy value is greater than 0.5.

[0070] For the second eigenvector, E(x2) = 0.9783. After comparing this value with the preset compression potential energy threshold, the potential energy value is greater than 0.5.

[0071] For the third eigenvector, E(x3) = 0.9724. After comparing this value with the preset compression potential energy threshold, the potential energy value is greater than 0.5.

[0072] For the fourth eigenvector, E(x4) = 0.3571. After comparing this value with the preset compression potential energy threshold, the potential energy value is less than 0.5.

[0073] Step S33: When the potential energy value of the image feature vector is less than or equal to the preset compression potential energy threshold, the image feature vector is compressed to obtain the first compressed image feature vector of the feature image.

[0074] Specifically, based on the comparison between the potential energy value of the image feature vector and a preset compression potential energy threshold, when the potential energy value of the image feature vector is less than or equal to the preset compression potential energy threshold, it indicates that the image feature vector needs compression processing, and the compressed image feature vector is set as the first compressed image feature vector of the corresponding feature image. For the fourth feature vector, E(x4) = 0.3571, and the potential energy value is less than 0.5, therefore compression is required, thus obtaining the first compressed image feature vector of the feature image. Further, compression is performed by gradually reducing the precision of the obtained first compressed image feature vector.

[0075] For example, it can be reduced from 32-bit floating-point numbers to 16-bit floating-point numbers, and then from 16-bit floating-point numbers to 8-bit integers, and so on. By continuously reducing the precision, the storage space of the feature vector is greatly reduced, thereby achieving the effect of compression.

[0076] Step S34: When the potential energy value of the image feature vector is greater than the preset compression potential energy threshold, the image feature vector is directly used as the first compressed image feature vector of the corresponding feature image.

[0077] Specifically, based on the comparison between the potential energy value of the image feature vector and the preset compression potential energy threshold, when the potential energy value of the image feature vector is greater than the preset compression potential energy threshold, it means that the image feature vector does not need to be compressed and is directly used as the first compressed image feature vector of the corresponding feature image.

[0078] Specifically, the first feature vector, E(x1) = 0.6978, has a potential energy value greater than 0.5; the second feature vector, E(x2) = 0.9783, has a potential energy value greater than 0.5; and the third feature vector, E(x3) = 0.9724, has a potential energy value greater than 0.5. None of them need to be compressed. The image feature vectors are directly used as the first compressed image feature vectors of the corresponding feature images.

[0079] The image compression method based on artificial intelligence in this application calculates the potential energy value through a preset potential energy function and compares the calculated potential energy value with a preset compression potential energy threshold to obtain the first compressed graphic feature vector of the feature image. This method achieves a higher compression ratio while preserving image details and reducing information loss during compression, so as to obtain a more accurate second compressed image feature vector in subsequent steps.

[0080] In one embodiment, in step S21, the target image is input into a pre-trained image feature neural network model to obtain several image feature vectors of the target image:

[0081] The image feature neural network model is the Inception-V3 model.

[0082] Specifically, Inception-V3 is a commonly used deep convolutional neural network model. Its core utilizes a series of Inception modules, which run multiple filters of different sizes in parallel at the same layer. This allows for the effective acquisition of feature information from input images of varying sizes, addressing issues such as overfitting and difficulties in propagating gradient updates across the entire network caused by excessive depth. This improves the network's adaptability to different scales while significantly reducing computational resources. Furthermore, Inception-V3 employs other techniques, such as auxiliary classifiers and average pooling, to further enhance the network's performance and stability. Inception-V3 has achieved excellent results in tasks such as image classification, object detection, and image compression. It not only extracts high-level image features but also effectively reduces computational resource consumption, making the model more efficient and practical.

[0083] The first step is data preprocessing: The training data for the Inception-V3 model typically comes from the ImageNet dataset, which contains 1000 images of different categories. Before training, the images used as training samples are preprocessed, including image normalization, scaling, and other operations, to facilitate training in the neural network.

[0084] The second step is to initialize the convolutional neural network model. The neural network model consists of multiple modules, each containing multiple parallel convolutional and pooling layers, as well as a 1×1 convolutional layer for dimensionality reduction or expansion of the channel count. Target image features are first extracted through the convolutional layers, resulting in several target image feature vectors. Then, the pooling layers weaken the positional information of these feature vectors and combine them to form more abstract target image features. This process of extraction and combination layer by layer forms a more complete descriptive feature of the entire image. After target image feature extraction, a fully connected layer performs dimensionality reduction on the target image data from the pooling layers, transforming all target image feature matrices from the pooling layers into one-dimensional feature vectors, thus avoiding the loss of important image feature information. In addition, auxiliary classifiers are introduced to reduce the vanishing gradient problem and improve the model's generalization ability.

[0085] The third step is model training: During the training process, the backpropagation algorithm is used to adjust the network parameters in order to minimize the loss function.

[0086] The fourth step is feature extraction: After training, the Inception-V3 model can be used to extract several image feature vectors from the target image. Specifically, the image is fed into the model, and through multiple convolutional and pooling operations, feature representations of the image at different scales can be obtained. These feature representations can then be used for subsequent tasks such as image compression.

[0087] The image compression method based on artificial intelligence in this application selects the Inception-V3 model as the image neural network model, which can effectively collect feature information in the image and efficiently extract high-level features of the image, thereby improving the network's adaptability to different scales and further reducing the consumption of computing resources.

[0088] In one embodiment, step S24, which involves performing image decompression and reconstruction processing on the second compressed image feature vectors of each of the feature images to obtain the decompressed and reconstructed image of the target image, may include the following steps:

[0089] The second compressed image feature vector of each of the aforementioned feature images is input into the trained image decompression and reconstruction model to obtain the decompressed and reconstructed image of the target image.

[0090] Specifically, after storing the first compressed image feature vectors of each feature image, the second compressed image feature vectors of each feature image can be obtained. The second compressed image feature vectors are then input into the trained image decompression and reconstruction model to obtain the decompressed and reconstructed image of the target image.

[0091] Decompression and reconstruction involves transforming the compressed image from its original pixel space into a higher-dimensional feature space, essentially converting the original pixels into a set of feature vectors. These feature vectors can better represent the image content and provide better image reconstruction results when using decompression algorithms.

[0092] The AI-based image compression method described in this application reconstructs and optimizes the compressed feature vectors during decompression to ensure the quality of the reconstructed image. During reconstruction, blurring or denoising can also be performed to improve the image compression and reconstruction effect. By inputting the second compressed image feature vector into a trained image compression and reconstruction model, a decompressed and reconstructed image of the target image is obtained. This method not only efficiently compresses the image but also preserves image details, providing a better image reconstruction effect.

[0093] In one embodiment, in step S24, i.e., performing image decompression and reconstruction processing on the second compressed image feature vectors of each of the feature images to obtain the decompressed and reconstructed image of the target image:

[0094] The image decompression and reconstruction model is a deconvolutional neural network model.

[0095] Specifically, a deconvolutional neural network (DCN) extracts features from a compressed feature vector through convolution operations, thereby reconstructing a compressed image. A DCN consists of alternating deconvolutional and convolutional layers. The deconvolutional layers perform upsampling operations, increasing the size of the feature map, while the convolutional layers perform convolution operations to extract features.

[0096] In this model, each layer reconstructs only the input image for the next layer. The difference between the reconstructed image and the input image is used as the error information for the objective function. To ensure non-negative feature values, a ReLU activation function is applied to each layer of the deconvolutional network, ensuring that each pixel value of the reconstructed feature is non-negative. The layers of the network are fully connected. As a neural network with only a decoder, the deconvolutional neural network achieves the reconstruction of low-dimensional vectors into high-dimensional vectors.

[0097] (1) Each layer of the deconvolutional neural network extracts features from the feature vector of the second compressed image along the top-down direction, and convolves the features with a convolution kernel to obtain a reconstructed image similar to the original image.

[0098] (2) Use the obtained reconstructed image as the input image of the next layer of the network structure, and repeat the above operation to obtain a new reconstructed image.

[0099] (3) The deconvolutional neural network performs the above operations layer by layer until the decompressed and reconstructed image of the target image is finally obtained.

[0100] In summary, the basic principle of deconvolutional neural networks is that the features of each layer in the network are convolved with their corresponding convolution kernels and summed. This process is repeated layer by layer to obtain a reconstructed image, while the filter and feature map parameters are continuously adjusted to reduce the error between the reconstructed image and the input image.

[0101] The image compression method based on artificial intelligence in this application embodiment inputs the image feature vector into the image decompression and reconstruction model, which can improve the image compression rate while preserving the image quality and details as much as possible, reducing information loss during compression, so as to better obtain the decompressed and reconstructed image and obtain a high-quality compressed image.

[0102] In one embodiment, in step S23, that is, storing the first compressed image feature vector of each of the feature images using a preset image storage format to obtain the second compressed image feature vector of each of the feature images:

[0103] The default image storage format is JPEG or PNG.

[0104] Specifically, JPEG and PNG are common image storage formats. JPEG is a lossy compression format, suitable for storing relatively small file sizes of photos or images. It achieves compression by reducing image details and color information, resulting in some loss of image quality. PNG, on the other hand, is a lossless compression format that maintains high quality and clarity during storage. It can compress image files to their limits for network transmission while retaining all information related to image quality. It is suitable for storing larger file sizes of images with high image quality. The specific image storage format can be chosen based on the specific usage scenario.

[0105] This application provides an artificial intelligence-based image compression method, which stores a first compressed image feature vector of a feature image using a preset image storage format to obtain a second compressed image feature vector of the feature image, so as to better obtain the decompressed and reconstructed image of the target image.

[0106] Corresponding to the above embodiment, an artificial intelligence-based image compression method, Figure 4 A structural block diagram of an AI-based image compression apparatus according to an embodiment of this application is shown. This image compression apparatus is applied to a terminal device. For ease of explanation, only the parts relevant to the embodiment of this application are shown.

[0107] In one embodiment, such as Figure 4 As shown, an artificial intelligence-based image compression device includes:

[0108] The image feature vector acquisition module 41 is used to acquire the target image to be processed, input the target image into the trained image feature neural network model, and obtain several image feature vectors of the target image.

[0109] The first compressed image feature vector extraction module 42 is used to quantize each of the image feature vectors using a preset potential energy function to obtain the first compressed image feature vector of each of the feature images.

[0110] The second compressed image feature vector extraction module 43 is used to store the first compressed image feature vector of each of the feature images using a preset image storage format, so as to obtain the second compressed image feature vector of each of the feature images.

[0111] The decompression and reconstruction image module 44 is used to perform image decompression and reconstruction processing on the second compressed image feature vector of each of the feature images to obtain the decompressed and reconstructed image of the target image.

[0112] Optionally, the first compressed image feature vector extraction module includes:

[0113] The potential energy value acquisition unit is used to calculate the potential energy value of each of the image feature vectors according to a preset potential energy function.

[0114] The comparison unit is used to compare the potential energy value of each of the image feature vectors with a preset compression potential energy threshold.

[0115] The first compressed image feature vector acquisition unit is used to compress the image feature vector when the potential energy value of the image feature vector is less than or equal to the preset compression potential energy threshold, so as to obtain the first compressed image feature vector of the feature image.

[0116] The image feature vector processing unit is used to directly use the image feature vector as the first compressed image feature vector of the corresponding feature image when the potential energy value of the image feature vector is greater than the preset compression potential energy threshold.

[0117] Optionally, the expression for presetting the potential energy function in the potential energy value acquisition unit is as follows:

[0118]

[0119] Wherein, E(x) i Let x be the potential energy function. i Let be the i-th feature vector, and α be the regularization coefficient, which is set to 1 by default. In practical applications, the value of α can be adjusted according to experimental data to make the classification effect more accurate. Usually, α can take values ​​in the range of [0,1] or [0,10].

[0120] Optionally, in the image feature vector acquisition module, the neural network model used to acquire the image features is the Inception-V3 model.

[0121] Optionally, the decompression and reconstruction image module includes:

[0122] The decompression and reconstruction image unit is used to input the second compressed image feature vector of each of the feature images into the trained image decompression and reconstruction model to obtain the decompressed and reconstructed image of the target image.

[0123] Optionally, in the image decompression and reconstruction module, the image decompression and reconstruction model used to acquire the image is a deconvolutional neural network model.

[0124] Optionally, in the second compressed image feature vector extraction module, the preset image storage format is JPEG or PNG.

[0125] It should be noted that the information interaction and execution process between the above modules are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0126] An embodiment of the present invention also provides an electronic device, including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the computer program, it implements the steps of the artificial intelligence-based image compression method described in any of the above embodiments.

[0127] This invention also provides a computer-readable medium having processor-executable non-volatile program code that causes the processor to perform the AI-based image compression method described in the above embodiments. Unless otherwise specifically stated, the relative steps, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of the invention.

[0128] Those skilled in the art will readily understand that, for the sake of convenience and brevity, the specific working processes of the systems and apparatus described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In all examples shown and described herein, any specific values ​​should be interpreted as merely exemplary and not as limitations; therefore, other examples of exemplary embodiments may have different values. The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0129] In the several embodiments provided herein, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units, i.e., they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, the functional units in the various embodiments of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. If the aforementioned function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0130] Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as disks, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solution of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the scope of the technology disclosed in the present invention, or make equivalent substitutions for some of the technical features. These modifications, changes, or substitutions do not cause the essence of the corresponding technical solution to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of this invention should be determined by the scope of the claims.

Claims

1. An image compression method based on artificial intelligence, characterized in that, The AI-based image compression method includes: The target image to be processed is obtained, and the target image is input into a pre-trained image feature neural network model to obtain several image feature vectors of the target image; The image feature vectors are quantized using a preset potential energy function to obtain the first compressed image feature vector of each feature image. The first compressed image feature vector of each of the feature images is stored using a preset image storage format to obtain the second compressed image feature vector of each of the feature images; The second compressed image feature vectors of each of the aforementioned feature images are subjected to image decompression and reconstruction processing to obtain the decompressed and reconstructed image of the target image; The image feature vectors are quantized using a preset potential energy function to obtain the first compressed image feature vector of each feature image, including: The potential energy value of each image feature vector is calculated according to a preset potential energy function; The potential energy value of each of the image feature vectors is compared with a preset compression potential energy threshold. When the potential energy value of the image feature vector is less than or equal to the preset compression potential energy threshold, the image feature vector is compressed to obtain the first compressed image feature vector of the feature image. When the potential energy value of the image feature vector is greater than the preset compression potential energy threshold, the image feature vector is directly used as the first compressed image feature vector of the corresponding feature image. Calculating the potential energy value of each image feature vector according to a preset potential energy function includes: The expression for the preset potential energy function is as follows: in, Let be the potential energy function. Let i be the feature vector of the i-th image. is the regularization coefficient.

2. The image compression method based on artificial intelligence as described in claim 1, characterized in that, The image feature neural network model is the Inception-V3 model.

3. The image compression method based on artificial intelligence as described in claim 1, characterized in that, The second compressed image feature vectors of each of the aforementioned feature images are subjected to image decompression and reconstruction processing to obtain the decompressed and reconstructed image of the target image, including: The second compressed image feature vector of each of the aforementioned feature images is input into the trained image decompression and reconstruction model to obtain the decompressed and reconstructed image of the target image.

4. The image compression method based on artificial intelligence as described in claim 3, characterized in that, The image decompression and reconstruction model is a deconvolutional neural network model.

5. The image compression method based on artificial intelligence as described in claim 1, characterized in that, The preset image storage format is JPEG or PNG.

6. An image compression device based on artificial intelligence, characterized in that, The AI-based image compression device includes: The image feature vector acquisition module is used to acquire the target image to be processed, input the target image into a pre-trained image feature neural network model, and obtain several image feature vectors of the target image. The first compressed image feature vector extraction module is used to quantize each of the image feature vectors using a preset potential energy function to obtain the first compressed image feature vector of each feature image. The second compressed image feature vector extraction module is used to store the first compressed image feature vector of each of the feature images using a preset image storage format, so as to obtain the second compressed image feature vector of each of the feature images. The image decompression and reconstruction module is used to perform image decompression and reconstruction processing on the second compressed image feature vector of each of the feature images to obtain the decompressed and reconstructed image of the target image; The first compressed image feature vector extraction module includes: The potential energy value acquisition unit is used to calculate the potential energy value of each of the image feature vectors according to a preset potential energy function. The comparison unit is used to compare the potential energy value of each of the image feature vectors with a preset compression potential energy threshold. The first compressed image feature vector acquisition unit is used to compress the image feature vector when the potential energy value of the image feature vector is less than or equal to the preset compression potential energy threshold, so as to obtain the first compressed image feature vector of the feature image. The image feature vector processing unit is used to directly use the image feature vector as the first compressed image feature vector of the corresponding feature image when the potential energy value of the image feature vector is greater than the preset compression potential energy threshold. In the potential energy value acquisition unit, the expression of the preset potential energy function is as follows: in, Let be the potential energy function. Let i be the feature vector of the i-th image. is the regularization coefficient.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the AI-based image compression method as described in any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the artificial intelligence-based image compression method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Image recognition and neural network model training method, device and system

    CN110163369A

  • Media asset recommendation method and device and computer readable storage medium

    CN116595200A