Image decompression method and device, equipment, storage medium and program product

By clustering and extracting features from images during the battery manufacturing process, and utilizing Gaussian distribution coding, the problems of high computational complexity and hardware dependence in existing technologies are solved, achieving efficient and stable image compression.

CN121665004APending Publication Date: 2026-03-13CONTEMPORARY AMPEREX TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies have high computational complexity in image compression during battery manufacturing, requiring a large amount of computing resources and being highly dependent on hardware. They are difficult to achieve efficient compression under limited resources, especially in industrial scenarios where the compression effect is unstable due to changes in lighting and inconsistent shooting angles.

Method used

By clustering pixels in the image, feature extraction and encoding are performed based on the clustered images. Encoding is performed using a Gaussian distribution to reduce redundant information and correlation in the feature matrix. Encoding is performed using a pre-trained Gaussian distribution to avoid fitting the entropy probability model.

Benefits of technology

It improves image compression efficiency, reduces computation steps and storage requirements, and enhances compression ratio and quality, adapting to the fast and stable compression needs of industrial scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121665004A_ABST
    Figure CN121665004A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image decompression method and device, equipment, a storage medium and a program product, and the method comprises the steps: carrying out the clustering of pixels on an image based on a preset clustering center, and obtaining a clustering image which comprises a plurality of feature categories; performing feature extraction on the clustered image to obtain a feature matrix; the feature extraction at least comprises normalizing pixels corresponding to each feature category on the clustered image based on normalization coefficients corresponding to each feature category on the clustered image; and coding the feature matrix based on Gaussian distribution obeyed by the feature matrix to obtain compressed data corresponding to the image. The image information compression is realized, the data volume is reduced, and the image compression efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of battery technology, and includes, but is not limited to, an image decompression method, apparatus, device, storage medium, and program product. Background Technology

[0002] Image compression technology is of great significance in industrial quality inspection and traceability. During battery manufacturing, a large amount of image data is generated that needs to be exchanged or stored. Compressing images can speed up the exchange process and reduce storage requirements.

[0003] Related technologies compress images through end-to-end image compression, which is based on deep neural networks to learn the representation of image content. However, this method requires a lot of computing resources and time, and is highly dependent on hardware devices, making it difficult to compress images efficiently when resources are limited. Summary of the Invention

[0004] To address the problems existing in related technologies, embodiments of this application provide an image decompression method, apparatus, device, storage medium, and program product. By clustering the pixels of an image and extracting and encoding features from the clustered images, not only is image information compression achieved, reducing the amount of data, but also image compression efficiency is improved.

[0005] In a first aspect, this application provides an image decompression method, which includes: clustering pixels in an image based on preset cluster centers to obtain a clustered image including multiple feature categories; extracting features from the clustered image to obtain a feature matrix; the feature extraction includes at least normalizing pixels corresponding to each feature category in the clustered image based on normalization coefficients corresponding to each feature category; and encoding the feature matrix based on a Gaussian distribution to obtain compressed data corresponding to the image.

[0006] In the above embodiments, the information represented by the image is compressed by clustering the pixels on the image. Then, feature extraction is performed based on the clustered images. During feature extraction, the pixels on the image can be grouped and normalized according to different feature categories. This not only reduces the correlation and redundant information between individuals in the feature matrix, which can improve the compression ratio, but also makes the data distribution of the feature matrix closer to the standard normal distribution. This allows the Gaussian distribution to be used for encoding, eliminating the need to fit the joint distribution of the feature matrix through an entropy probability model. This reduces the steps in image compression and improves image compression efficiency.

[0007] In some embodiments, feature extraction of a clustered image to obtain a feature matrix includes: performing a first feature extraction on the clustered image to obtain a first feature map; performing at least one residual processing on the first feature map to obtain a feature matrix; wherein the output of the previous residual processing is used as the input of the next residual processing.

[0008] In some embodiments, residual processing includes: performing a second feature extraction on the first feature map to obtain a second feature map; determining the feature categories corresponding to the feature points in the second feature map, and calculating the mean and variance corresponding to each feature category; normalizing the feature points of each category on the second feature map based on the mean and variance corresponding to each category to obtain a third feature map; adding the first feature map and the third feature map to obtain a fused feature map; and performing a nonlinear transformation on the fused feature map to obtain a feature matrix.

[0009] In the above embodiments, the normalization method provided in feature extraction reduces the correlation of feature points in the feature matrix, making the distribution of feature points on the feature matrix independent of their position. This allows the feature matrix to use the same Gaussian parameters, meaning the feature matrix follows a Gaussian distribution. This improves the image compression ratio while ensuring compression quality, and also accelerates the compression process.

[0010] In some embodiments, feature extraction is implemented through an encoding network. To extract features from a clustered image and obtain a feature matrix, the method includes: performing a first feature extraction on the clustered image through a convolutional network of the encoding network to obtain a first feature map; and performing at least one residual processing on the first feature map through at least one residual network of the encoding network to obtain a feature matrix; wherein the output of the previous residual processing is used as the input of the next residual processing.

[0011] In some embodiments, the first feature map is subjected to at least one residual processing through the residual network of the encoding network to obtain a feature matrix, including: performing a second feature extraction on the first feature map through a convolutional layer in the residual network to obtain a second feature map; determining the feature categories corresponding to the feature points in the second feature map through a normalization layer in the residual network, and calculating the mean and variance corresponding to each feature category; normalizing the feature points of each category on the second feature map based on the mean and variance corresponding to each category to obtain a third feature map; adding the first feature map and the third feature map to obtain a fused feature map; and performing a nonlinear transformation on the fused feature map through an activation layer in the residual network to obtain a feature matrix.

[0012] In some embodiments, the feature matrix is ​​encoded based on a Gaussian distribution to obtain compressed data corresponding to the image. This includes: using an entropy coding network, concatenating the feature matrix row by row based on the row order to obtain a one-dimensional feature vector; discretizing the Gaussian distribution to determine the probability and initial coding interval of each element in the one-dimensional feature vector; determining the coding interval of the next element based on the initial coding interval and interval gap of the previous element, according to the order of the elements in the one-dimensional feature vector, until the coding interval of the last element is obtained, which serves as the vector coding interval of the one-dimensional feature vector; determining any value in the vector coding interval as the target coding result of the one-dimensional feature vector; and performing binary encoding on the target coding result to obtain compressed data.

[0013] In the above embodiments, Gaussian distribution is used to entropy encode the feature matrix, so that the present application embodiments do not need to determine the probability distribution of the feature matrix through an entropy probability model, thereby reducing the data processing steps and improving the efficiency of image compression.

[0014] In some embodiments, the image decompression method further includes: performing entropy decoding on the compressed data through an entropy decoding network to obtain a decoding feature matrix; and performing an inverse transformation on the decoding feature matrix through a decoding network to obtain a compressed decoded image corresponding to the image.

[0015] In the above embodiments, after obtaining the compressed data of the image, it can be stored in a designated area, saving storage space, which is especially important for devices with limited memory. When the image is needed, the compressed data can be decompressed through an entropy decoding network and a decoding network to obtain a decompressed image, which can meet various application scenarios.

[0016] In some embodiments, entropy decoding is performed on compressed data based on an entropy decoding network to obtain a decoded feature matrix, including: performing binary decoding on the compressed data based on the entropy decoding network to obtain a target value; determining the encoding interval where the target value is located and the first element of the one-dimensional decoded feature vector based on the initial encoding interval of each element in the entropy coding network; dividing the encoding interval where the target value is located based on the initial encoding interval, and determining the next element of the first element according to the divided interval, until all elements of the one-dimensional decoded feature vector are obtained; and segmenting all elements of the one-dimensional feature vector to obtain a decoded feature matrix.

[0017] In some embodiments, based on the decoding network, an inverse transformation is performed on the decoding feature matrix to obtain a compressed decoded image corresponding to the image, including: performing at least one decoding residual processing on the decoding feature matrix through at least one decoding residual network in the decoding network to obtain a decoded feature map; wherein, at least one decoding residual network corresponds one-to-one with at least one residual network of the encoding network, and the input of the decoding residual processing is the result of adding the output of the previous decoding residual network or the entropy decoding network with the output of the residual processing corresponding to the decoding residual processing; and performing upsampling convolution on the decoded feature map through the transposed convolution network in the decoding network to obtain a compressed decoded image.

[0018] In some embodiments, the image decompression method is implemented through a trained image decompression model, which includes an encoding network, an entropy encoding network, an entropy decoding network, and a decoding network. A Gaussian distribution is obtained by training the image decompression model based on sample images of the process in which the image is located. The image decompression model and the Gaussian distribution are trained as follows: based on cluster centers, pixels in the sample images are clustered to obtain sample cluster images including multiple feature categories; the sample cluster images are input into the image decompression model; features are extracted from the sample cluster images through the encoding network in the image decompression model to obtain a sample feature matrix; and entropy encoding in the image decompression model is used to further extract features. The network and the initial Gaussian distribution are used to encode the sample feature matrix to obtain the sample compressed data corresponding to the sample image. The entropy decoding network in the image decompression model is used to entropy decode the sample compressed data to obtain the sample decoded feature matrix. The decoding network in the image decompression model is used to perform an inverse transformation on the sample decoded feature matrix to obtain the sample compressed decoded image corresponding to the sample image. The sample compressed decoded image and the sample image are input into the first preset loss model to obtain the first loss result. Based on the first loss result, the model parameters of the encoding network, entropy encoding network, entropy decoding network and decoding network and the parameters of the initial Gaussian distribution are corrected to obtain the trained image decompression model and Gaussian distribution.

[0019] In some embodiments, the image decompression method further includes: determining the cluster center of each image acquisition object and the clustering feature corresponding to each cluster center on the image based on the image acquisition objects corresponding to different feature categories in the process in which the image is located; correspondingly, clustering the pixels on the image based on the preset cluster centers to obtain clustered images with different categories, including: calculating the feature distance between the pixels on the image and the clustering feature corresponding to each cluster center to obtain multiple feature distances of the pixels; determining the feature category corresponding to the cluster center that satisfies the distance condition as the feature category of the pixel among the multiple feature distances; and obtaining the clustered image based on the feature category of each pixel on the image.

[0020] In the above embodiments, clustering transforms a three-channel image into a single-channel clustered image, compressing the information, reducing the amount of information during image compression, and improving the image compression speed.

[0021] In some embodiments, the image decompression method further includes: performing downsampling feature extraction on the clustered image based on the downsampling network in the pre-trained fully connected layer network to obtain a downsampling feature map; performing upsampling feature recovery on the downsampling feature map based on the upsampling network in the fully connected layer network to obtain a preprocessed image; correspondingly, performing feature extraction on the clustered image to obtain a feature matrix, including: performing feature extraction on the preprocessed image to obtain a feature matrix.

[0022] In the above embodiments, by first downsampling to adaptively reduce the image resolution and then upsampling to restore the high resolution of the image, the compression effect can be optimized and the image quality of the preprocessed image can be improved.

[0023] In some embodiments, downsampling feature extraction is performed on the clustered image to obtain a downsampling feature map, including: performing a first convolution process on the clustered image to obtain a first convolutional feature map; calculating the distance between each feature point on the first convolutional feature map to obtain the similarity between each feature point; clustering the feature points on the first convolutional feature map based on the similarity to obtain multiple feature categories; determining a feature point in each feature category as the target feature point of the feature category, and generating a target feature map based on the target feature point of each feature category; and performing a second convolution process on the target feature map to obtain a downsampling feature map.

[0024] In the above embodiments, during downsampling, based on the similarity of features in the first convolutional feature map, some feature points are dynamically selected for subsequent convolution, reducing the amount of data computation.

[0025] In some embodiments, performing upsampling feature recovery on the downsampled feature map to obtain a preprocessed image includes: performing a first transposed convolution on the downsampled feature map to obtain a second convolutional feature map; the kernel size of the first transposed convolution and the second convolution are the same; filling the transposed feature points in the second convolutional feature map to all feature points of the feature category in which the transposed feature points are located to obtain a filled feature map; the transposed feature points correspond to the target feature points; performing a second transposed convolution on the filled feature map to obtain a preprocessed image; the kernel size of the second transposed convolution and the first convolution are the same.

[0026] In the above embodiments, by first downsampling to adaptively reduce the image resolution and then upsampling to restore the image's high resolution, the compression effect can be optimized and the image quality of the preprocessed image can be improved.

[0027] In some embodiments, the fully connected layer network is trained as follows: based on cluster centers, the pixels on the sample images of the process in which the image is located are clustered to obtain sample cluster images including multiple feature categories; the sample cluster images are subjected to discrete cosine transform to obtain a comparison image; the sample cluster images are input into the fully connected layer network; based on the downsampling network in the fully connected layer network, downsampling features are extracted from the sample cluster images to obtain a sample downsampling image; based on the upsampling network in the fully connected layer network, upsampling features are restored from the sample downsampling image to obtain a sample preprocessed image; the sample preprocessed image and the comparison image are input into a second preset loss model to obtain a second loss result; based on the second loss result, the model parameters in the downsampling network and the upsampling network are corrected to obtain the trained fully connected layer network.

[0028] In the above embodiments, by training a fully connected layer network to fit the Fast Cosine Discrete Transform (FCT) algorithm, the trained fully connected layer can not only simulate the FCT algorithm, reduce the information entropy of clustered images, and improve the image compression ratio, but also reduce the iterative operations in the FCT algorithm, thereby reducing the amount of computation and improving the image compression efficiency.

[0029] Secondly, embodiments of this application provide an image compression apparatus, comprising: a clustering module for clustering pixels in an image based on preset cluster centers to obtain a clustered image including multiple feature categories; a feature extraction module for extracting features from the clustered image to obtain a feature matrix; the feature extraction includes at least normalizing pixels corresponding to each feature category in the clustered image based on normalization coefficients corresponding to each feature category; and an encoding module for encoding the feature matrix based on a Gaussian distribution to obtain compressed data corresponding to the image.

[0030] In the above embodiments, the information represented by the image is compressed by clustering the pixels on the image. Then, feature extraction is performed based on the clustered images. During feature extraction, the pixels on the image can be grouped and normalized according to different feature categories. This not only reduces the correlation and redundant information between individuals in the feature matrix, which can improve the compression ratio, but also makes the data distribution of the feature matrix closer to the standard normal distribution. This allows the use of a pre-trained Gaussian distribution for encoding, eliminating the need to fit the joint distribution of the feature matrix through an entropy probability model. This reduces the steps in image compression and improves image compression efficiency.

[0031] Thirdly, embodiments of this application provide an image compression device, including: a memory for storing executable instructions; and a processor for executing the executable instructions stored in the memory to implement the steps in the above-described image decompression method.

[0032] Fourthly, embodiments of this application provide a computer-readable storage medium storing executable instructions, which, when executed by a processor, implement the steps of the image decompression method described above.

[0033] Fifthly, embodiments of this application provide a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps in the above-described image decompression method.

[0034] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0035] Figure 1 This is a schematic diagram of the structure of the image decompression device provided in the embodiments of this application;

[0036] Figure 2 This is an optional flowchart illustrating the image decompression method provided in the embodiments of this application. Figure 1 ;

[0037] Figure 3 This is an optional flowchart illustrating the image decompression method provided in the embodiments of this application. Figure 2 ;

[0038] Figure 4 This is a schematic diagram of the structure of Gaussian distribution training provided in an embodiment of this application;

[0039] Figure 5 This is an optional flowchart illustrating the image decompression method provided in the embodiments of this application. Figure 3 ;

[0040] Figure 6 These are comparison images of the die-cutting process before and after image clustering provided in the embodiments of this application;

[0041] Figure 7 This is a comparison image of the top cover welding process before and after image clustering provided in the embodiments of this application;

[0042] Figure 8 This is a schematic diagram of the structure of the fully connected layer provided in an embodiment of this application;

[0043] Figure 9 This is a schematic diagram of the image decompression model provided in the embodiments of this application. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0045] In the following description, references to "some embodiments" refer to a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same or different subsets of all possible embodiments and may be combined with each other without conflict. Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art to which the embodiments of this application pertain. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit the application.

[0046] Currently, new energy batteries are increasingly widely used in daily life and industry. They are not only used in energy storage systems such as hydropower, thermal power, wind power, and solar power plants, but also extensively used in electric vehicles such as electric bicycles, electric motorcycles, and electric cars, as well as in aerospace and other fields. With the continuous expansion of the application areas of power batteries, the market demand is also constantly increasing. In this application embodiment, the battery involved can be a battery cell, also known as a battery unit. A battery cell refers to a basic unit capable of converting chemical energy into electrical energy, which can be used to manufacture battery modules or battery packs to supply power to electrical devices. A battery cell can be a rechargeable battery, which refers to a battery cell that can be recharged after discharge to activate the active materials and continue to be used. Battery cells can be lithium-ion batteries, sodium-ion batteries, sodium-lithium-ion batteries, lithium metal batteries, sodium metal batteries, lithium-sulfur batteries, magnesium-ion batteries, nickel-metal hydride batteries, nickel-cadmium batteries, lead-acid batteries, etc., and this application embodiment is not limited to these.

[0047] In this application embodiment, the term "battery cell" can refer to any shape, such as a square cell or a round cell. Furthermore, "battery cell" typically refers to a battery cell, which is one of the basic units constituting a battery. The battery cell is the core component of a battery, responsible for storing and releasing electrical energy. A battery cell can be a lithium-ion battery cell (Li-ion Cell), a lithium-polymer battery cell (Li-polymer Cell), a nickel-metal hydride battery cell (NiMH Cell), etc. This application embodiment does not limit the type of battery cell; the specific type can be selected according to the actual application scenario.

[0048] In this embodiment, the battery cell is the core component of the battery pack. A battery pack typically includes multiple battery cells, which are combined to provide the required energy capacity and voltage. The components of a battery pack include at least: individual battery cells, a battery management system (BMS), a casing, wiring harnesses, connectors, and interfaces. These components work together to combine the battery cells into a fully functional battery pack for various applications. For example, the battery pack can be used in electric vehicles, energy storage systems, portable electronic devices, solar power systems, wind power systems, emergency backup power supplies, power tools, or electric bicycles, etc. This embodiment does not impose any limitations on this; the specific choice can be made according to the actual application scenario.

[0049] It should be noted that the battery pack can use different types of battery cells, such as lithium-ion batteries, nickel-metal hydride batteries, lithium polymer batteries, etc., depending on the specific application requirements and performance specifications.

[0050] In this embodiment, the battery may also be a single physical module comprising one or more battery cells to provide higher voltage and capacity. When there are multiple battery cells, the multiple battery cells are connected in series, parallel, or mixed via a busbar.

[0051] In battery manufacturing, images need to be captured at each stage of the process for real-time monitoring of battery components. These images may also need to be exchanged between different stages or stored for later traceability. Therefore, image compression is necessary to improve efficiency. Deep learning methods are used to train models for image compression; however, these models have high computational complexity, requiring significant computing resources and time, and are heavily reliant on GPUs and other hardware, making efficient compression difficult under resource constraints. Furthermore, the robustness of these technologies to noise and image distortion needs improvement, especially in industrial settings where challenges such as varying lighting and inconsistent shooting angles can lead to unstable compression results. The processing and training efficiency of these technologies for large-scale image data needs further optimization to ensure fast, stable, and high-quality image compression in real-world industrial production environments.

[0052] To alleviate the problems existing in related technologies, the applicant provides an efficient image compression algorithm suitable for industrial applications. Based on the limited number of objects captured in industrial images (e.g., only background, tabs, and large surfaces), the pixels in the industrial image can be clustered to compress the information represented by the image. Then, feature extraction is performed based on the clustered images. During feature extraction, normalization can be performed by grouping pixels according to their different categories. This not only reduces the correlation and redundant information between individuals in the feature matrix, improving the compression ratio, but also makes the data distribution of the feature matrix closer to a standard normal distribution. This allows for the use of a pre-trained Gaussian distribution for entropy encoding, eliminating the need to fit the joint distribution of the feature matrix using an entropy probability model. This reduces the steps involved in image compression and improves image compression efficiency.

[0053] Based on the above considerations, the inventors, after in-depth research, have provided an image decompression method. This method involves clustering pixels in an image based on preset cluster centers to obtain a clustered image containing multiple feature categories. Feature extraction is then performed on the clustered image to obtain a feature matrix. Feature extraction includes at least normalizing the pixels corresponding to each feature category in the clustered image based on the normalization coefficients corresponding to each feature category. Finally, the feature matrix is ​​encoded based on a Gaussian distribution to obtain compressed data corresponding to the image. The Gaussian distribution is obtained by training on multiple acquired images from the process in which the image is located.

[0054] Figure 1 This is a schematic diagram of the structure of the image decompression device provided in the embodiments of this application. Figure 1 The image decompression device shown includes at least one processor 110, a memory 150, at least one network interface 120, and a user interface 130. The various components in the image decompression device are coupled together via a bus system 140. It is understood that the bus system 140 is used to implement communication between these components. In addition to a data bus, the bus system 140 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 1 The general labeled all buses as Bus System 140.

[0055] The processor 110 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0056] The processor 110 can also be a graphics processing unit (GPU), which can perform parallel compression on a large number of industrial images.

[0057] User interface 130 includes one or more output devices 131 that enable the presentation of media content, and one or more input devices 132.

[0058] Memory 150 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. Memory 150 may optionally include one or more storage devices physically located remote from processor 110. Memory 150 may include volatile memory or non-volatile memory, or both. Non-volatile memory may be read-only memory (ROM), and volatile memory may be random access memory (RAM). The memory 150 described in this application embodiment is intended to include any suitable type of memory. In some embodiments, memory 150 is capable of storing data to support various operations, examples of which include programs, modules, and data structures, or subsets or supersets thereof, as exemplified below.

[0059] Operating system 151 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;

[0060] The network communication module 152 is used to reach other computing devices via one or more (wired or wireless) network interfaces 120, such as Bluetooth, WiFi, and Universal Serial Bus.

[0061] The input processing module 153 is used to detect one or more user inputs or interactions from one or more input devices 132, and to translate the detected inputs or interactions.

[0062] In some embodiments, the apparatus provided in this application may be implemented in software. Figure 1An image decompression device 154 stored in memory 150 is shown. This image decompression device 154 can be software in the form of programs and plugins within an image decompression device, including the following software modules: a clustering module 1541, a feature extraction module 1542, and an encoding module 1543. These modules are logically linked and can therefore be arbitrarily combined or further split according to their implemented functions. The functions of each module will be described below.

[0063] In other embodiments, the apparatus provided in this application can also be implemented in hardware. As an example, the image decompression apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the image decompression method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0064] The image decompression method disclosed in this application can be applied to any scenario requiring image decompression. The executing entity is an image decompression device, which can be any terminal with image decompression functionality, or it can be a server. The processor used for image processing in the image decompression device can be a central processing unit (CPU) or a GPU; this application is not limited to either. The technical solution of this application will be described in detail below with reference to the accompanying drawings.

[0065] Figure 2 This is an optional flowchart illustrating the image decompression method provided in the embodiments of this application. Figure 1 ,like Figure 2 As shown, the image decompression method provided in this application embodiment can be implemented through steps S201 to S203:

[0066] Step S201: Based on the preset cluster centers, cluster the pixels on the image to obtain a clustered image that includes multiple feature categories.

[0067] In some embodiments, an image can refer to an industrial image, which can be an image of each process captured during battery manufacturing. The characteristic of an industrial image is that the objects captured in the image are limited. For example, an industrial image may only contain three types of objects: background, tabs, and large surfaces. Therefore, the pixels in an industrial image can be clustered to compress the information represented by the industrial image.

[0068] Pixel clustering is based on the distance between each pixel and the cluster center. Since there are limited objects in an industrial image, this embodiment can pre-set cluster centers for the industrial image. These centers can be set based on the colors of different regions in the image. For example, if an industrial image only contains a battery and a background, with the battery displaying a white color and the background displaying a black color, two cluster centers can be set. Each cluster center uses a color value as its feature value. One cluster center has a feature value of (0, 0, 0), and the other has a feature value of (255, 255, 255). The distance between the color value of each pixel and the two cluster centers is calculated, and the category of the nearest cluster center is taken as the feature category of the pixel to achieve pixel clustering.

[0069] In this embodiment of the application, after clustering, the three-channel industrial image becomes a single-channel clustered image, which compresses the information, reduces the amount of information during image compression, and improves the image compression speed.

[0070] Step S202: Extract features from the clustered image to obtain a feature matrix; the feature extraction includes at least normalizing the pixels corresponding to each feature category in the clustered image based on the normalization coefficients corresponding to each feature category.

[0071] In some embodiments, feature extraction of clustered images can be achieved through an encoding network. The clustered images are converted into feature matrices by modules such as convolutional layers, normalization layers, and activation layers in the encoding network, so as to extract key information from the clustered images and reduce the amount of data.

[0072] In the embodiments of this application, since the images are clustered, the pixels of the same feature category in the clustered images are almost uncorrelated or have the same value (for example, the pixels in a cluster have the same value, which is used to characterize the feature category of the pixel), so that when normalizing, the points of a feature category can use the same normalization parameters (i.e., mean and variance).

[0073] Therefore, in the embodiments of this application, the same mean and variance are used for normalization of individuals of the same feature category. In other words, different normalizations are performed for individuals of different feature categories. This can not only reduce the correlation between feature points in the coding network and improve the compression ratio, but also accelerate the efficiency of image compression.

[0074] Here, the normalization coefficients for different categories refer to the mean and variance of pixels in that category, which are calculated from the feature values ​​of all individuals in each category.

[0075] Step S203: Based on the Gaussian distribution that the feature matrix follows, the feature matrix is ​​encoded to obtain the compressed data corresponding to the image.

[0076] In this embodiment, because the clustering results based on the clustering image in the encoding network are normalized, the distribution of feature points in the feature matrix output by the encoding network in the latent space is independent of the position of the feature points. Therefore, the Gaussian model of the latent space is globally correlated, that is, the mean and variance of all feature points in the latent space can be the same, that is, all feature points of the feature matrix follow a Gaussian distribution. Therefore, during encoding, the feature matrix is ​​encoded based on the Gaussian distribution followed by the feature matrix output by the encoding network to obtain compressed data, which can be binary data.

[0077] In some embodiments, industrial images of a process are quite similar. Therefore, a Gaussian distribution can be trained based on the industrial images of each process to ensure that the feature matrix of the image of that process follows the same distribution. This allows the images of a process to use the same Gaussian distribution during entropy encoding, reducing the steps required to calculate the distribution for each industrial image and improving the efficiency of image compression.

[0078] In this embodiment, Gaussian distribution is used for entropy encoding, eliminating the need for an entropy probability model, reducing data processing steps, and improving the efficiency of image compression.

[0079] In some embodiments, the encoding can be entropy encoding, or it can be implemented using variable-length encoding or arithmetic encoding, i.e., Asymmetric Numeral Systems (ANS). For example, the feature matrix (which can be a two-dimensional matrix) is concatenated row by row into a one-dimensional vector, and the discrete probability distribution of each element in the one-dimensional vector is determined based on the Gaussian distribution followed by the feature matrix. Encoding is then performed based on the probability distribution to obtain the final encoding result.

[0080] This application embodiment compresses the information represented by the image by clustering the pixels on the image, and then extracts features based on the clustered images. During feature extraction, the pixels on the image can be grouped and normalized according to different categories. This not only reduces the correlation and redundant information between individuals in the feature matrix, which can improve the compression ratio, but also makes the data distribution of the feature matrix closer to the standard normal distribution. This allows the use of a pre-trained Gaussian distribution for encoding, eliminating the need to fit the joint distribution of the feature matrix through an entropy probability model. This reduces the steps in image compression and improves image compression efficiency.

[0081] Figure 3 This is an optional flowchart illustrating the image decompression method provided in the embodiments of this application. Figure 2 ,like Figure 3 As shown, step S202 in the image decompression method provided in this application embodiment can be implemented by steps S301 to S302:

[0082] Step S301: Extract the first feature from the clustered image to obtain the first feature map.

[0083] In some embodiments, the first feature extraction can be achieved through a convolutional layer, which can be a convolutional layer with a 2*2 kernel and a stride of 1. In this embodiment, the clustering image is a single-channel image, and the number of convolutional kernels can be set to determine the number of output channels of the first feature map. Here, the clustering image can be convolved with 128 convolutional kernels to obtain a 128-channel first feature map.

[0084] The first feature extraction uses multiple convolution kernels to extract signals from different frequency bands of the clustered image, so that the first feature map contains more details of the clustered image and improves the image compression quality.

[0085] Step S302: Perform at least one residual processing on the first feature map to obtain the feature matrix; wherein the output of the previous residual processing is used as the input of the next residual processing.

[0086] In this embodiment, the first feature map can be subjected to multiple residual processing steps to obtain a feature matrix. In each residual processing step, the output of the previous residual processing step is used as the input of the next residual processing step. Multiple residual layers can enhance feature extraction capabilities, extracting more abstract features and better image details.

[0087] In some embodiments, step S302 can be implemented by steps S3021 to S3024:

[0088] Step S3021: Extract the second feature from the first feature map to obtain the second feature map.

[0089] In some embodiments, the encoding network can input the first feature map output by the convolutional layer into multiple sequentially connected residual blocks. Each residual block consists of a convolutional layer, a normalization layer, and an activation layer. The convolutional layer can extract first features from the first feature map to obtain a second feature map. Here, the stride of the convolutional layer can be the same as or different from that of the first convolutional layer.

[0090] Step S3022: Determine the feature category corresponding to the feature point in the third feature map, and calculate the mean and variance of each feature category.

[0091] In this embodiment of the application, after obtaining the second feature map, the second feature map can be normalized based on prior clustering (PCNorm). Since this application clusters the image, this embodiment of the application can use an index based on the clustering results of the image to normalize the feature points of the same class in the second feature map using the same mean and variance. That is, different normalizations are performed on individuals of different feature classes. The mean and variance are calculated from the feature values ​​of all individuals in each feature class.

[0092] Step S3023: Based on the mean and variance of each feature category, normalize the feature points of each feature category on the second feature map to obtain the third feature map.

[0093] In this embodiment, after obtaining the mean and variance of each feature category, the feature points of each feature category are standardized using the mean and variance of that feature category to obtain standardized feature values. After standardizing each feature point on the second feature map, a third feature map is obtained. Here, standardization can be achieved using formula (1):

[0094]

[0095] Where, x norm denoted as the standardized eigenvalues, x represents the eigenvalues ​​of the feature points in the second feature map, μ is the mean, and σ is the variance.

[0096] Step S3024: Add the first feature map and the third feature map to obtain the fused feature map.

[0097] In some embodiments, the normalized third feature map can be added to the first feature map to obtain a fused feature map, so that the coding network can retain the feature information of the previous layer and ensure the information content of the compressed data.

[0098] Step S3025: Perform a nonlinear transformation on the fused feature map to obtain the feature matrix.

[0099] In some embodiments, a feature matrix can be obtained by introducing nonlinearity into the normalized fused feature map through the activation layer. Here, the feature matrix can be a two-dimensional feature matrix.

[0100] This application embodiment reduces the correlation of feature points in the feature matrix by using the normalization method provided in feature extraction, so that the distribution of feature points on the feature matrix is ​​independent of their position, and the feature matrix can use the same Gaussian parameters, that is, follow a Gaussian distribution. This improves the compression ratio of the image while ensuring compression quality, and can also accelerate the compression process.

[0101] In some embodiments, feature extraction and encoding in the image decompression method can be implemented using an encoding network and an entropy encoding network in a pre-trained image decompression model. The encoding network can include a convolutional network and at least one residual network.

[0102] Correspondingly, step S202 can also be achieved through steps S2021 to S2022.

[0103] Step S2021: Extract the first feature from the clustered image using the convolutional network of the encoding network to obtain the first feature map.

[0104] Step S2022: Perform at least one residual processing on the first feature map through at least one residual network of the encoding network to obtain the feature matrix; wherein the output of the previous residual processing is used as the input of the next residual processing.

[0105] In some embodiments, the residual network includes at least convolutional layers, normalization layers, and activation layers. Therefore, residual processing can be implemented through the following steps:

[0106] The second feature map is obtained by extracting the second feature from the first feature map through the convolutional layer in the residual network. The feature class corresponding to the feature points in the second feature map is determined by the normalization layer in the residual network, and the mean and variance of each feature class are calculated. Based on the mean and variance of each class, the feature points of each class in the second feature map are normalized to obtain the third feature map. The first feature map and the third feature map are added to obtain the fused feature map. The fused feature map is then subjected to a nonlinear transformation through the activation layer in the residual network to obtain the feature matrix.

[0107] The steps for feature extraction using an encoding network in this application are the same as those in the aforementioned embodiments, and will not be repeated here.

[0108] In some embodiments, the feature matrix can be encoded using arithmetic coding; therefore, step S203 in the image decompression method can be implemented using steps S2031 to S2035.

[0109] Step S2031: Using an entropy coding network, the feature matrix is ​​concatenated row by row based on the row order of the feature matrix to obtain a one-dimensional feature vector.

[0110] In the embodiments of this application, the feature matrix can be a two-dimensional matrix. When performing arithmetic encoding, the two-dimensional matrix can be concatenated into a one-dimensional vector by row, and encoding can be performed based on the discrete probability distribution of each element in the one-dimensional vector.

[0111] Step S2032: Discretize the Gaussian distribution to determine the probability of each element in the one-dimensional feature vector and the initial encoding interval.

[0112] In some embodiments, discretizing the Gaussian distribution followed by the feature matrix can refer to adding random noise to the Gaussian noise and quantizing it to obtain a discrete probability distribution followed by the one-dimensional feature vector. Based on the discrete probability distribution, the probability of each eigenvalue in the one-dimensional feature vector is determined, and the encoding interval for each eigenvalue is determined based on the probability. For example, if the one-dimensional feature vector contains elements ABCD with probabilities of 0.1, 0.4, 0.2, and 0.3 respectively, the initial encoding intervals for each element are [0, 0.1), [0.1, 0.5), [0.5, 0.7), and [0.7, 1.0].

[0113] Step S2033: According to the order of each element in the one-dimensional feature vector, based on the initial encoding interval and interval interval of the previous element, determine the encoding interval of the next element, until the encoding interval of the last element is obtained, which is used as the vector encoding interval of the one-dimensional feature vector.

[0114] In the embodiments of this application, when encoding a one-dimensional feature vector, the elements in the one-dimensional feature vector are read in sequentially according to the order of each element. Based on the interval of the previous element, the encoding interval of the next element is continuously updated until the last element is read in, and the final encoding interval is obtained. This interval is then used as the vector encoding interval of the one-dimensional feature vector.

[0115] For example, assuming the order of the one-dimensional feature vector is CADACDB, it is read in sequentially starting from the first element. First is C, with an initial encoding range of [0.5, 0.7) and an interval of 0.2. After reading, the encoding range is [0.5, 0.7). Next is A, with an initial encoding range of [0, 0.1) and an interval of 0.1. Based on the encoding range and interval of the previous element, the encoding interval corresponding to A is updated to [0.5, 0.52). Then is D, resulting in an encoding range of [0.514, 0.52), and so on, resulting in Table 1:

[0116] Table 1

[0117]

[0118] The final vector encoding interval is obtained as [0.5143876, 0.514402), and this interval is used as the encoding interval of the one-dimensional feature vector.

[0119] Step S2034: Determine any value in the vector encoding interval as the target encoding result of the one-dimensional feature vector.

[0120] Here, any value within the vector encoding range can be used as the encoding result of the encoding matrix, for example, 0.5143879.

[0121] Step S2035: Perform binary encoding on the target encoding result to obtain compressed data.

[0122] In this embodiment of the application, the encoding result can also be saved as a binary file to achieve image compression.

[0123] In this embodiment, Gaussian distribution is used to entropy encode the feature matrix, which eliminates the need to determine the probability distribution of the feature matrix through an entropy probability model, reducing data processing steps and improving the efficiency of image compression.

[0124] In some embodiments, after obtaining the compressed image data, it can be stored in a designated area, and the compressed data can be decompressed when needed to obtain a decompressed image. The image decompression model may also include an entropy decoding network and a decoding network. Based on this, the image decompression method provided in this application embodiment may further include steps S1 and S2:

[0125] Step S1: Use an entropy decoding network to perform entropy decoding on the compressed data to obtain the decoding feature matrix.

[0126] In this embodiment, entropy decoding can be implemented through an entropy decoding network. The structure of the entropy decoding network is mirrored that of the entropy encoding network. Therefore, entropy decoding of compressed data can yield a decoded feature matrix with the same number of rows and columns as the feature matrix.

[0127] In some embodiments, the entropy decoding step performed by the entropy decoding network is the reverse of the encoding step performed by the entropy coding network, and entropy decoding can be implemented through steps S11 to S14:

[0128] Step S11: Based on the entropy decoding network, perform binary decoding on the compressed data to obtain the target value.

[0129] In some embodiments, the compressed data is binary data, which needs to be binary decoded to obtain the target value, for example, 0.5143879.

[0130] Step S12: Based on the initial encoding interval of each element in the entropy coding network, determine the encoding interval where the target value is located and the first element of the one-dimensional decoding feature vector.

[0131] Based on the aforementioned embodiments, the initial encoding intervals of each element ABCD are [0, 0.1), [0.1, 0.5), [0.5, 0.7) and [0.7, 1.0), respectively, to obtain the encoding interval [0.5, 0.7) where the target value is located and the first element C of the one-dimensional decoded feature vector.

[0132] Step S13: Divide the encoding interval where the target value is located based on the initial encoding interval, and determine the next element of the first element according to the divided interval, until all elements of the one-dimensional decoded feature vector are obtained.

[0133] Dividing the encoding interval containing the target value based on the initial encoding interval can mean dividing the encoding interval containing the target value based on the interval interval corresponding to the initial encoding interval. For example, if the interval intervals are 0.1, 0.4, 0.2, and 0.3, after dividing [0.5, 0.7), we get [0.5, 0.52), [0.52, 0.6), [0.6, 0.64), and [0.64, 0.7). At this time, the encoding interval containing the target value is [0.5, 0.52). Therefore, the next element after the first element is A, and so on, to obtain all elements of the one-dimensional decoded feature vector CADACDB.

[0134] Step S14: Segment all elements of the one-dimensional feature vector to obtain the decoded feature matrix.

[0135] In this embodiment, the opposite of concatenation in the entropy coding network is to segment all elements of the one-dimensional feature vector to obtain the decoded feature matrix.

[0136] Step S2: Through the decoding network, perform an inverse transformation on the decoding feature matrix to obtain the compressed decoded image corresponding to the image.

[0137] In some embodiments, the inverse transform can be implemented through a decoding network, which is also a mirror image of the encoding network. The decoding network can use a decoding residual network and transposed convolutional layers to integrate and restore features. The convolutional layers in the decoding network are the transposed convolutional layers corresponding to the convolutional layers in the encoding network. The inverse transform is performed on the decoding feature matrix, and the features in the decoding feature matrix are recombined and restored to a compressed decoded image with the same resolution as the original image.

[0138] Step S2 can be achieved through steps S221 and S222:

[0139] Step S221: Perform at least one decoding residual processing on the decoding feature matrix through at least one decoding residual network in the decoding network to obtain a decoding feature map; wherein, at least one decoding residual network corresponds one-to-one with at least one residual network of the encoding network, and the input of the decoding residual processing is the result of adding the output of the previous decoding residual network or entropy decoding network with the output of the residual processing corresponding to the decoding residual processing.

[0140] In this embodiment, the number of decoding residual networks in the decoding network is the same as the number of residual networks in the encoding network and they are mirrored. The input to the decoding residual processing is the sum of the output of the previous decoding residual network or entropy decoding network and the output of the residual processing corresponding to the decoding residual processing.

[0141] Step S222: Upsample the decoded feature map by using the transposed convolutional network in the decoding network to obtain the compressed decoded image.

[0142] Here, the transposed convolutional network has the same kernel size as the convolutional network in the encoding network, so that the compressed decoded image has the same resolution as the image.

[0143] After obtaining the compressed image data, the embodiments of this application can store it in a designated area, saving storage space, which is especially important for devices with limited memory. When the image is needed, the compressed data can be decompressed to obtain a decompressed image, meeting various application scenarios.

[0144] In some embodiments, Figure 4 This is a schematic diagram of the structure of Gaussian distribution training provided in an embodiment of this application, which can be used... Figure 4 The image decompression model shown is trained using a Gaussian distribution. The image decompression model includes at least an encoding network 401, an entropy encoding network 402, an entropy decoding network 403, and a decoding network 404. In this embodiment, multiple images X from one process can be input into the image decompression model. After passing through the encoding network 401, a feature matrix y is obtained. The feature matrix y and a pre-set initial Gaussian distribution are input into the entropy encoding network 402 to obtain compressed data corresponding to each of the multiple images. Based on the entropy decoding network 403 and the decoding network 404, each compressed data is decoded to obtain a compressed decoded image. The compressed decoded image and the image are input into a loss model. Based on the results of the loss model, the parameters of each module in the image decompression model and the mean and variance of the Gaussian distribution are adjusted until the similarity between the image input to the image decompression model and the compressed decoded image output by the image decompression model is greater than a threshold, thus obtaining that the image of this process follows a Gaussian distribution.

[0145] In some embodiments, the image decompression method is implemented through a trained image decompression model, which includes an encoding network, an entropy encoding network, an entropy decoding network, and a decoding network; the Gaussian distribution is obtained by training based on the sample images of the process in which the image is located and the image decompression model; the image decompression model and the Gaussian distribution are trained through steps S401 to S408:

[0146] Step S401: Based on the cluster centers, cluster the pixels on the sample images to obtain sample cluster images that include multiple feature categories.

[0147] Here, the clustering method is the same as in the previous embodiments.

[0148] Step S402: Input the sample clustering image into the image decompression model.

[0149] Step S403: Extract features from the sample clustering image using the encoding network in the image decompression model to obtain the sample feature matrix.

[0150] Step S404: Encode the sample feature matrix using the entropy coding network and initial Gaussian distribution in the image decompression model to obtain the sample compressed data corresponding to the sample image.

[0151] Step S405: Through the entropy decoding network in the image decompression model, entropy decoding is performed on the sample compressed data to obtain the sample decoding feature matrix.

[0152] Step S406: Through the decoding network in the image decompression model, perform inverse transformation on the sample decoding feature matrix to obtain the sample compressed decoding image corresponding to the sample image.

[0153] Step S407: Input the sample compressed and decoded image and the sample image into the first preset loss model to obtain the first loss result.

[0154] Here, the second preset loss model can be a contrastive loss, a pixel-wise loss function, or a perceptual loss function. The distance between the sample compressed / decoded image and the sample image is calculated based on this loss function. The similarity between the sample compressed / decoded image and the sample image is determined based on this distance. A larger distance corresponds to a smaller similarity between the sample compressed / decoded image and the sample image; conversely, a smaller distance corresponds to a larger similarity. This similarity is then used as the first loss result of the model.

[0155] Step S408: Based on the first loss result, the model parameters of the encoding network, entropy encoding network, entropy decoding network and decoding network and the parameters of the initial Gaussian distribution are corrected to obtain the trained image decompression model and Gaussian distribution.

[0156] In this embodiment of the application, based on the second loss result, the model parameters and initial Gaussian distribution parameters of the encoding network, entropy encoding network, entropy decoding network and decoding network can be corrected. Based on the corrected image decompression model, the sample compressed and decoded images are processed again, and the processed sample compressed and decoded images and sample images are compared. The model parameters are updated again until the similarity between the sample compressed and decoded images and the sample images is greater than the similarity threshold (e.g., 95%). At this time, the trained image decompression model is obtained.

[0157] After training to obtain the Gaussian distribution that the image in this process follows, the image compression in this application can be directly calculated using the Gaussian distribution. There is no need to set an entropy probability model for the image compression model to determine the probability distribution of the feature matrix. This reduces the structure of the image compression model, reduces the processing steps of the image decompression method, improves efficiency, and reduces the computational load on the GPU.

[0158] In some embodiments, the pre-determining of the cluster centers of the images can be achieved through step S10:

[0159] Step S10: Based on the image acquisition objects corresponding to different feature categories in the process where the image is located, determine the cluster center of each image acquisition object on the image and the cluster features corresponding to each cluster center.

[0160] In some embodiments, the image can be an industrial image. The characteristic of an industrial image is that the image acquisition pairs on the image are limited. For example, an industrial image may only contain three types of objects: background, electrode, and large surface. Therefore, cluster centers can be pre-set for industrial images. These centers can be set based on the colors of different regions on the image. For example, if an industrial image only contains a battery and a background, with the battery displaying a white color and the background displaying a black color, then two cluster centers can be set. Each cluster center uses color values ​​as feature values, with one feature value being (0, 0, 0) and the other feature value being (255, 255, 255).

[0161] Correspondingly, step S201 can be achieved through steps S2011 to S2013:

[0162] Step S2011: Calculate the feature distance between each pixel in the image and the cluster feature corresponding to each cluster center to obtain multiple feature distances of the pixel.

[0163] In some embodiments, the feature distance can be Euclidean distance, which can be calculated by measuring the Euclidean distance between the color feature value of each pixel in the image and the cluster feature corresponding to the cluster center, thus obtaining multiple feature distances between each pixel and each cluster center.

[0164] Step S2012: Among multiple feature distances, the feature category corresponding to the cluster center that satisfies the distance condition is determined as the feature category of the pixel.

[0165] Here, satisfying the clustering condition can mean minimizing the feature distance. That is, among the multiple feature distances between each pixel and each cluster center, the feature category corresponding to the cluster center with the smallest distance is determined as the feature category of each pixel.

[0166] Step S2013: Obtain a clustered image based on the feature category of each pixel in the image.

[0167] After obtaining the feature category of each pixel in the image, the three-channel image can be converted into a single-channel clustered image. At this time, the feature of each pixel in the clustered image is the feature category of that pixel.

[0168] In this embodiment, clustering transforms a three-channel image into a single-channel clustered image, compressing the information, reducing the amount of information during image compression, and improving the image compression speed.

[0169] In this embodiment of the application, in order to reduce the information entropy in the clustered image, the clustered image can also be subjected to de-entropy processing. Figure 5 This is an optional flowchart illustrating the image decompression method provided in the embodiments of this application. Figure 3 ,like Figure 5 As shown, the image decompression method provided in this application embodiment may further include steps S501 and S502:

[0170] Step S501: Based on the downsampling network in the pre-trained fully connected layer network, perform downsampling feature extraction on the clustered image to obtain the downsampling feature map.

[0171] In this embodiment of the application, the high information entropy in the clustered image can be reduced by fitting a fully connected layer network of fast discrete cosine transform (DCT). The fully connected layer network is trained in advance.

[0172] Here, the fully connected layer network can remove some noise in the clustered image through downsampling and upsampling.

[0173] In some embodiments, step S501 can be implemented by steps S5011 to S5015:

[0174] Step S5011: Perform a first convolution process on the clustered image to obtain a first convolution feature map.

[0175] When processing images, the DCT algorithm divides the image into blocks. In order to fit the DCT algorithm, and considering the characteristic of industrial images having fewer categories, the size and stride of the first convolutional processing kernel can be set to be relatively large, for example, both the size and stride are 8. That is, a large-sized convolutional kernel is used to downsample the clustered image, thereby improving the feature extraction of global features of the clustered image and obtaining the first convolutional feature map.

[0176] Step S5012: Calculate the distance between each feature point on the first convolutional feature map to obtain the similarity between each feature point.

[0177] Here, since there are few categories in the clustered image, the pixels of each category will form a large region. Therefore, there may be adjacent feature points with the same features in the first convolution feature map, such as both extracting features from the background region. Therefore, the embodiments of this application can dynamically select some feature points for subsequent convolution processing based on the similarity of features in the first convolution feature map. That is, select one from multiple pixels with the same features to input into the next convolution layer to reduce the amount of data computation.

[0178] Here, the similarity between feature points can be determined based on the Euclidean distance between each feature point. If the similarity reaches a threshold (e.g., 90%), the two feature points are considered to be of the same class.

[0179] Step S5013: Based on similarity, cluster the feature points on the first convolutional feature map to obtain multiple first feature categories.

[0180] In this embodiment of the application, when the similarity between two feature points reaches a threshold (e.g., 90%), the two feature points are considered to be of the same class, thereby obtaining multiple first feature categories on the first convolutional feature map.

[0181] Step S5014: Determine a feature point in each first feature category as the target feature point of the first feature category, and generate a target feature map based on the target feature point of each first feature category.

[0182] In this embodiment, a feature point can be determined in each first feature category as the target feature point of that first feature category. Only the target feature point enters the next convolutional layer, and a target feature map is generated based on the target feature point of each first feature category. Here, the size of the target feature map can be the same as the size of the first convolutional feature map; however, the feature values ​​of points other than the target feature point on the target feature map can be set to 0 and not participate in subsequent convolutions. The size of the target feature map can also be smaller than the size of the first convolutional feature map, meaning the target feature map contains only the target feature point.

[0183] Step S5015: Perform a second convolution on the target feature map to obtain a downsampled feature map.

[0184] In this embodiment, after the target feature map is determined, the feature map is downsampled again by convolution to obtain a downsampled feature map. Here, the second convolution process can be implemented by multiple convolutional layers.

[0185] In this embodiment of the application, during downsampling, some feature points are dynamically selected for subsequent convolution based on the similarity of features in the first convolution feature map, thereby reducing the amount of data computation.

[0186] Step S502: Based on the upsampling network in the fully connected layer network, perform upsampling feature recovery on the downsampled feature map to obtain the preprocessed image.

[0187] In this embodiment of the application, after downsampling, the resolution of the feature map can be increased by upsampling to restore the size of the clustered image in order to capture more detailed information.

[0188] The structure of the upsampling network can be mirrored with that of the downsampling network so that the size of the preprocessed image obtained by upsampling is the same as the size of the clustered image.

[0189] In some embodiments, step S502 can be implemented by steps S5021 to S5023:

[0190] Step S5021: Perform a first transpose convolution on the downsampled feature map to obtain a second convolution feature map; the size of the convolution kernels for the first transpose convolution and the second convolution is the same.

[0191] In this embodiment, the first transposed convolutional processing and the second convolutional processing are structurally mirrored. Therefore, the first transposed convolutional processing can be implemented by multiple transposed convolutional layers, and the size of the resulting second convolutional feature map is the same as the size of the target feature map.

[0192] Step S5022: Fill the transposed feature points in the second convolution feature map to all feature points of the feature category where the transposed feature points are located, to obtain the filled feature map; the transposed feature points correspond to the target feature points.

[0193] Here, since the size of the second convolutional feature map is the same as the size of the target feature map, and the position of the transposed feature point in the second convolutional feature map corresponds one-to-one with the position of the target feature point, it is necessary to fill back the feature points discarded in the downsampling. Therefore, in this embodiment, the transposed feature points in the second convolutional feature map can be filled to all feature points of the feature category in which the transposed feature points are located, to obtain a filled feature map.

[0194] Step S5023: Perform a second transpose convolution on the filled feature map to obtain a preprocessed image; the size of the convolution kernel in the second transpose convolution is the same as that in the first convolution.

[0195] In this embodiment, the second transposed convolution processing can be implemented by a transposed convolution layer that is mirrored with the convolution layer of the first convolution processing, and a preprocessed image is obtained based on the transposed convolution layer.

[0196] This application embodiment optimizes the compression effect and improves the image quality of the preprocessed image by first downsampling to adaptively reduce the image resolution and then upsampling to restore the high resolution of the image.

[0197] Correspondingly, after obtaining the preprocessed image, feature extraction can be performed on the preprocessed image to obtain the feature matrix.

[0198] The fully connected network provided in this application embodiment fits the Fast Cosine Discrete Transform algorithm, which reduces the information entropy of the clustered image and improves the compression ratio. Furthermore, by first downsampling to adaptively reduce the image resolution and then upsampling to restore the high resolution of the image, the compression effect can be optimized and the image quality of the preprocessed image can be improved.

[0199] In this embodiment of the application, the training of the fully connected layer network can be achieved through steps S20 to S26:

[0200] Step S20: Based on the cluster centers, cluster the pixels on the sample images of the process in which the image is located to obtain sample cluster images that include multiple feature categories.

[0201] In some embodiments, the sample images can be a large number of images in the process in which the images are located. The clustering method provided in the foregoing embodiments can be used to cluster the sample images separately to obtain sample cluster images, which are single-channel images.

[0202] Step S21: Perform discrete cosine transform on the sample clustering image to obtain a comparison image.

[0203] In this embodiment of the application, the sample clustering images can be processed by the DCT algorithm to obtain the contrast images used to supervise the fully connected layer.

[0204] Step S22: Input the sample clustering image into the fully connected layer network.

[0205] Step S23: Based on the downsampling network in the fully connected layer network, perform downsampling feature extraction on the sample clustering image to obtain the sample downsampling image.

[0206] Step S24: Based on the upsampling network in the fully connected layer network, perform upsampling feature recovery on the sample downsampled image to obtain the sample preprocessed image.

[0207] Step S25: Input the preprocessed sample image and the comparison image into the preset second loss model to obtain the second loss result.

[0208] In some embodiments, the second preset loss model may be a contrastive loss, a pixel-wise loss function, or a perceptual loss function, which calculates the distance between the preprocessed sample image and the contrast image. Based on the distance, the similarity between the preprocessed sample image and the contrast image is determined. Here, the larger the distance, the lower the similarity between the preprocessed sample image and the contrast image; the smaller the distance, the higher the similarity between the preprocessed sample image and the contrast image. The similarity is determined as the second loss result of the model.

[0209] Step S26: Based on the second loss result, the model parameters in the downsampling network and the upsampling network are corrected to obtain the trained fully connected layer network.

[0210] In this embodiment of the application, based on the second loss result, the model parameters in the downsampling network and the upsampling network can be corrected. Based on the corrected fully connected layer network, the sample clustering image is processed again. The preprocessed sample image and the comparison image are then compared, and the model parameters are updated again until the similarity between the preprocessed sample image and the comparison image is greater than the similarity threshold (e.g., 95%). At this point, the trained fully connected layer network is obtained.

[0211] In this embodiment, a fully connected layer network can be trained to fit the fast cosine discrete transform algorithm, so that the trained fully connected layer can reduce the information entropy of the clustered image and improve the image compression ratio.

[0212] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.

[0213] Image compression using Efficient Learned Image Compression (ELIC) based on non-uniform grouping spatial channel context adaptive coding suffers from high computational complexity, requiring significant resources and time. It also heavily relies on GPUs and other hardware, making efficient compression difficult under resource constraints. Furthermore, its robustness to noise and image distortion needs improvement, particularly in industrial settings with challenges such as varying lighting and inconsistent shooting angles, leading to unstable compression results. Further optimization of the processing and training efficiency of this technology for large-scale image data is needed to ensure rapid and stable image compression and quality maintenance in real-world industrial environments. The adaptive coding strategy may introduce additional computational latency, affecting encoding and decoding speeds. The model's inference speed may be insufficient for real-time processing, and inconsistent computational accuracy across different deep learning frameworks can degrade model performance.

[0214] Based on the problems existing in related technologies, there is a need for an efficient image compression algorithm suitable for industrial application scenarios. The embodiments of this application combine deep learning and clustering algorithms to achieve efficient compression and storage of images, meet the needs of efficient utilization and management of image resources, and thus provide strong support for the traceability of battery quality problems and life cycle management.

[0215] This application provides a fast image decompression method based on a latent space global correlation entropy model, which mainly consists of an image preprocessing part and an image compression part. The preprocessing part includes image clustering and de-entropy processing.

[0216] In some embodiments, industrial images (i.e., images) have a uniform pixel distribution, allowing for rapid clustering operations. Based on the characteristics of industrial images, during image clustering, a limited number of cluster centers can be pre-defined based on the process in which the image is located (the cluster centers can be set according to the colors of different regions on the industrial image). The pixels on the image are clustered based on the cluster centers. After clustering, the clustering result (scalar) of each pixel (3D vector) is obtained. In this way, the input image is transformed from a three-channel image into a single-channel image (the pixel values ​​on the clustered image represent the feature category of that pixel), and the clustering method provided in this application results in almost no information loss.

[0217] Figure 6 These are comparison images of the die-cutting process before and after image clustering, as provided in the embodiments of this application. Figure 7 These are comparison images of the top cover welding process before and after image clustering provided in the embodiments of this application, such as... Figure 6 As shown, Figure 6Figure a shows an image captured during the battery die-cutting process. Based on different regions of this image, four cluster centers are pre-set: the roller area, the die area, the tab area, and the film area. Through the clustering steps provided in this embodiment, the pixels in the image can be divided into four categories, such as... Figure 6 As shown in Figure b, the pixels are divided into roller area 601, module area 602, tab 603 and film area 604.

[0218] Figure 7 Figure a shows an image captured during the top cover welding process. Based on different regions in this image, four cluster centers are pre-set: background, side, top cover surface, and fixture. Through the clustering steps provided in this embodiment, the pixels in the image can be divided into four categories, such as... Figure 7 As shown in Figure b, the pixels are divided into background 701, side 702, top cover 703, and fixture 704.

[0219] In this embodiment, the de-entropy processing can be implemented using a pre-trained fully connected layer. This fully connected layer is used to fit a fast discrete cosine transform (DCT) to reduce the amount of information in the image while retaining effective information, thereby mitigating the high entropy problem in clustered images. Here, since the DCT algorithm in related technologies involves a large number of iterative calculations, and the computational load increases exponentially with the image size, this embodiment uses a fully connected layer to fit the DCT algorithm. This not only reduces the high entropy in the image but also reduces the computational load and improves computational efficiency.

[0220] Figure 8 This is a schematic diagram of the structure of the fully connected layer provided in the embodiments of this application, as shown below. Figure 8 As shown, the fully connected layer may include a first linear layer 801, a downsampling layer 802, an upsampling layer 803, and a second linear layer 804. The clustering image input to the fully connected layer is a single-channel image. After the clustering image is input to the fully connected layer, the image parameters (such as the contrast of the clustering image) can be adjusted through the first linear layer 801 to perform feature enhancement. The feature-enhanced single-channel image is then input to the downsampling layer 802.

[0221] In some embodiments, the downsampling layer 802 may include multiple convolutional layers. The number of convolutional layers is set according to the computational requirements. In this embodiment, three convolutional layers are set in the downsampling layer 802 for downsampling. Each convolutional layer has a different convolutional kernel. For example, the first convolutional layer has an 8*8 kernel and a stride of 8; the second convolutional layer has a 4*4 kernel and a stride of 4; and the third convolutional layer has a 2*2 kernel and a stride of 2.

[0222] Here, due to the relatively uniform pixel distribution of industrial images, a larger convolutional kernel can be selected for the first downsampling, extracting features from an 8x8 region at a time to obtain the first feature map (i.e., the first convolutional feature map). Each pixel in the first feature map represents the features of an 8x8 region in the input image. At this point, as... Figure 6 As shown, since there are fewer categories in industrial images, the pixels of each category will form a large area. Therefore, there may be adjacent pixels with the same features in the first feature map, such as both extracting features from the background area. Therefore, the embodiments of this application can dynamically select some channels for subsequent convolution based on the similarity of features in the first feature map. That is, select one of the pixels with the same features to input into the next convolutional layer to reduce the amount of data computation.

[0223] In this embodiment, the downsampling layer 802 performs multiple convolutions on the single-channel image to obtain a downsampling feature map, which is then input into the upsampling layer 803. The upsampling layer 803 can be composed of multiple transposed convolutional layers, and the number and settings of the transposed convolutional layers correspond to those of the downsampling layer 802. That is, the upsampling layer 803 and the downsampling layer 802 are mirror images of each other, and are used to restore the downsampling feature map to the output single-channel image. Here, the single-channel image has the same size as the single-channel image input to the downsampling layer 802.

[0224] It should be noted that in the upsampling layer 803, before entering the last transposed convolutional layer, the selected representative features will be filled back into the corresponding positions, which corresponds to the selection operation of the downsampling layer 802.

[0225] Finally, the output single-channel image obtained from the upsampling layer 803 is input into the second linear layer 804 to obtain the processed image after de-entropy. This processed image reduces the information entropy in the image and improves the compression ratio.

[0226] The fully connected layer provided in this embodiment can be pre-trained using a large number of industrial training images. The industrial training images are input into the fully connected layer to obtain training images. Simultaneously, the industrial training images are processed using a DCT algorithm to obtain comparison images. The comparison images and training images are then input into a loss function to improve the parameters of the fully connected layer. Here, the loss function can be a reconstruction loss, such as Mean Squared Error (MSE) and Structural Similarity Index (SSIM).

[0227] The fully connected layer provided in this application for simulating the DCT algorithm has a fast computation speed and supports computation on a GPU.

[0228] In some embodiments, the image compression part can be implemented by a model based on an image compression algorithm, which may include an encoding network, an entropy encoding network, an entropy decoding network, and a decoding network. Figure 9 This is a schematic diagram of the structure of the image compression model provided in the embodiments of this application. The model may include an encoding network 901, an entropy encoding network 902, an entropy decoding network 903, and a decoding network 904.

[0229] In some embodiments, a single-channel processed image X is input into a decoding network 901 for feature extraction to obtain high-dimensional encoded features Y. The encoded features are then entropy encoded by an entropy coding network 902 to obtain a binary file, thereby completing the compression of the industrial image.

[0230] In some embodiments, when decoding a binary file to restore an image, the binary file is input into an entropy decoding network 903 to obtain decoding features Y′, and then the decoding features Y′ are input into a decoding network 904 to obtain the restored image X′.

[0231] In this embodiment, the coding network 901 may consist of a convolutional layer and multiple residual blocks, each residual block including a convolutional layer, an activation layer and a normalization layer.

[0232] In this embodiment, the input to the encoding network 901 can be a single-channel image, which reduces the amount of computation, accelerates the compression process, and results in a smaller latent space for the output image. This allows the subsequent entropy encoding network 902 to encode smaller features, thus requiring less storage space to store the compressed features output by the entropy encoding network.

[0233] Here, to make the points in the feature space of the coding network uncorrelated, this application provides a normalization method based on prior clustering (PCN orm). This method is a novel group normalization method (Group Norm). Since this application clusters industrial images, the embodiments of this application can use an index based on the clustering results of industrial images to normalize individuals of the same class in the feature space using the same mean and variance. That is, different normalizations are performed on individuals of different classes. The mean and variance are calculated from the feature values ​​of all individuals in each class.

[0234] In the embodiments of this application, after clustering the industrial images, the points of the same category in the clustered images are almost uncorrelated or have completely identical values ​​(e.g., points in a cluster have the same value), so that when normalizing, points of a category can use the same Gaussian parameters (i.e., mean and variance).

[0235] The normalization method proposed in this application can not only reduce the correlation between feature points in the coding network and improve the compression ratio, but also accelerate the efficiency of image compression.

[0236] In this embodiment, because the encoding network performs normalization based on clustering, the distribution of feature points in the latent space of the encoded features output by the encoding network is independent of the position of the feature points. Therefore, the Gaussian model of the latent space is globally correlated, meaning that the mean and variance of all feature points in the latent space can be the same. In other words, the feature points in the encoded feature Y can use the same Gaussian parameters, meaning that all feature points in the encoded feature Y follow a Gaussian distribution. During entropy encoding, the encoded feature Y is encoded based on the Gaussian distribution followed by the encoded feature Y output by the encoding network to obtain a binary file.

[0237] In some embodiments, statistical measures prepared offline in advance can be used to train the Gaussian distribution that each process image follows. Here, the Gaussian distribution can be trained using an image decompression model. Multiple industrial images of a process are input into the image decompression model, and after encoding, entropy encoding / decoding, and decoding stages, multiple restored images are obtained after compression. The restored images and industrial images are input into a loss model, and the parameters of the image decompression model and the mean and variance of the Gaussian distribution are adjusted based on the results of the loss model until the similarity between the industrial images input into the image decompression model and the restored images output by the image decompression model is greater than a threshold, thus obtaining the Gaussian distribution that the industrial images of that process follow.

[0238] In the entropy coding stage of actual image compression, the Gaussian distribution used is independent of the coding feature Y output by the coding network. This avoids the incompatibility problem caused by the inconsistent computational precision between the training format PyTorch and the inference format ONNX when deploying the image compression model, which ultimately prevents the original image from being restored.

[0239] This application improves the compression ratio by using globally consistent Gaussian parameters, thanks to the design of the coding network that makes the latent space location independent.

[0240] In some embodiments, entropy coding can use arithmetic coding or asymmetric numeral systems (ANS) coding to compress the coding matrix Y into a binary file based on the Gaussian distribution that the coding matrix Y follows.

[0241] The following explanation of entropy coding uses arithmetic coding as an example. First, the encoded feature Y (a two-dimensional matrix) output by the coding network can be concatenated row-wise into a one-dimensional vector. Then, encoding is performed based on the discrete probability distribution of each element in the one-dimensional vector.

[0242] Here, the discrete probability distribution of each element in the one-dimensional vector is obtained based on the Gaussian distribution followed by the encoding matrix Y. The specific steps are as follows: determine the eigenvalues ​​of each element in the one-dimensional vector, each eigenvalue follows a Gaussian distribution, calculate the discrete probability of each eigenvalue, and then obtain the encoding interval of each eigenvalue. During arithmetic encoding, read the elements in the one-dimensional vector in sequence and continuously update the encoding interval until the last element is read in, and obtain the final encoding interval. Use any value in the encoding interval as the encoding value of the encoding matrix. The encoding value can be saved as a binary file to achieve the compression of industrial images.

[0243] In some embodiments, for example, the encoding matrix to be encoded contains elements ABCD, and the probability of each element appearing is determined based on a Gaussian distribution as shown in Table 2:

[0244] Table 2

[0245]

[0246] Now, we read in a one-dimensional vector (e.g., CADACDB) sequentially. First, we read in C, with an initial interval of [0.5, 0.7), and the encoding interval is [0.5, 0.7). Next, we read in A, with an initial interval of [0, 0.1), and the corresponding encoding interval is [0.5, 0.52). Then, we read in D, and the encoding interval is [0.514, 0.52), ..., finally resulting in Table 3:

[0247] Table 3

[0248]

[0249] Finally, any number can be selected from the obtained encoding interval as the output of the entropy encoding result of the encoding matrix. For example, if the encoding feature is 0.5143879, it can be saved as a binary file to achieve image compression.

[0250] Here, as Figure 9 As shown, the network structures of encoding network 901 and decoding network 904, as well as entropy encoding network 902 and entropy decoding network 903, can be mirrored. The specific network structures of entropy decoding network 903 and decoding network 904 will not be elaborated here. The output of the residual block in encoding network 901 will be used as the input of the mirrored residual block in decoding network 904, as shown below. Figure 9 As shown.

[0251] This application embodiment reduces the correlation of feature points in the feature matrix by using PCNorm in the encoding network, thereby improving the image compression ratio and accelerating the compression process. Simultaneously, it reduces the computational load during image compression by clustering industrial images to compress individual pixels, further accelerating the compression process. Furthermore, this application embodiment reduces the information entropy of the clustered images through pre-trained fully connected layers to improve the compression ratio.

[0252] based on Figure 1 The provided image decompression device 154 includes a clustering module 1541, used to cluster pixels on an image based on preset cluster centers to obtain a clustered image including multiple feature categories; a feature extraction module 1542, used to extract features from the clustered image to obtain a feature matrix; the feature extraction includes at least normalizing pixels corresponding to each feature category on the clustered image based on the normalization coefficients corresponding to each feature category; and an encoding module 1543, used to encode the feature matrix based on the Gaussian distribution it follows to obtain compressed data corresponding to the industrial image.

[0253] In some embodiments, the feature extraction module 1542 is further configured to perform a first feature extraction on the clustered image to obtain a first feature map; and to perform at least one residual processing on the first feature map to obtain a feature matrix; wherein the output of the previous residual processing is used as the input of the next residual processing.

[0254] In some embodiments, the feature extraction module 1542 is further configured to perform a second feature extraction on the first feature map to obtain a second feature map; determine the feature categories corresponding to the feature points in the second feature map, and calculate the mean and variance corresponding to each feature category; based on the mean and variance corresponding to each feature category, normalize the feature points of each feature category on the second feature map to obtain a third feature map; add the first feature map and the third feature map to obtain a fused feature map; and perform a nonlinear transformation on the fused feature map to obtain a feature matrix.

[0255] In some embodiments, the feature extraction module 1542 is further configured to perform a first feature extraction on the clustered image through a convolutional network of the encoding network to obtain a first feature map; and to perform at least one residual processing on the first feature map through at least one residual network of the encoding network to obtain a feature matrix; wherein the output of the previous residual processing is used as the input of the next residual processing.

[0256] In some embodiments, the feature extraction module 1542 is further configured to: extract second features from the first feature map through a convolutional layer in the residual network to obtain a second feature map; determine the feature categories corresponding to feature points in the second feature map through a normalization layer in the residual network, and calculate the mean and variance corresponding to each feature category; normalize the feature points of each feature category in the second feature map based on the mean and variance corresponding to each feature category to obtain a third feature map; add the first feature map and the third feature map to obtain a fused feature map; and perform a nonlinear transformation on the fused feature map through an activation layer in the residual network to obtain a feature matrix.

[0257] In some embodiments, the encoding module 1543 is further configured to: concatenate the feature matrix row by row based on the row order of the feature matrix using an entropy encoding network to obtain a one-dimensional feature vector; discretize the Gaussian distribution to determine the probability and initial encoding interval of each element in the one-dimensional feature vector; determine the encoding interval of the next element based on the initial encoding interval and interval gap of the previous element, according to the order of each element in the one-dimensional feature vector, until the encoding interval of the last element is obtained, which serves as the vector encoding interval of the one-dimensional feature vector; determine any value in the vector encoding interval as the target encoding result of the one-dimensional feature vector; and perform binary encoding on the target encoding result to obtain compressed data.

[0258] In some embodiments, the image decompression apparatus further includes: an entropy decoding module, used to perform entropy decoding on the compressed data through an entropy decoding network to obtain a decoding feature matrix; and an inverse transformation module, used to perform an inverse transformation on the decoding feature matrix through a decoding network to obtain a compressed decoded image corresponding to the industrial image.

[0259] In some embodiments, the entropy decoding module is further configured to perform binary decoding on the compressed data based on the entropy decoding network to obtain the target value; determine the encoding interval where the target value is located and the first element of the one-dimensional decoding feature vector based on the initial encoding interval of each element in the entropy encoding network; divide the encoding interval where the target value is located based on the initial encoding interval, and determine the next element of the first element according to the divided interval, until all elements of the one-dimensional decoding feature vector are obtained; and segment all elements of the one-dimensional feature vector to obtain the decoding feature matrix.

[0260] In some embodiments, the decoding module is further configured to perform at least one decoding residual processing on the decoding feature matrix through at least one decoding residual network in the decoding network to obtain a decoding feature map; wherein, at least one decoding residual network corresponds one-to-one with at least one residual network of the encoding network, and the input of the decoding residual processing is the result of adding the output of the previous decoding residual network or the entropy decoding network with the output of the residual processing corresponding to the decoding residual processing; and to perform upsampling convolution on the decoding feature map through the transposed convolution network in the decoding network to obtain a compressed decoded image.

[0261] In some embodiments, the image decompression method is implemented through a trained image decompression model, which includes an encoding network, an entropy encoding network, an entropy decoding network, and a decoding network. A Gaussian distribution is obtained by training the image decompression model based on sample images of the image processing step. The apparatus further includes a training module. The training module is used to cluster pixels on the sample images based on cluster centers, obtaining sample cluster images including multiple feature categories. The sample cluster images are input into the image decompression model. Features are extracted from the sample cluster images through the encoding network in the image decompression model to obtain a sample feature matrix. The entropy encoding network and the decoding network in the image decompression model are then used to further refine the model. An initial Gaussian distribution is used to encode the sample feature matrix, resulting in compressed sample data corresponding to the sample image. The entropy decoding network in the image decompression model performs entropy decoding on the compressed sample data, yielding a decoded sample feature matrix. The decoding network in the image decompression model performs an inverse transformation on the decoded sample feature matrix, resulting in a compressed and decoded sample image corresponding to the sample image. The compressed and decoded sample image and the sample image are input into a first preset loss model to obtain a first loss result. Based on the first loss result, the model parameters of the encoding network, entropy encoding network, entropy decoding network, and decoding network, as well as the parameters of the initial Gaussian distribution, are corrected to obtain the trained image decompression model and Gaussian distribution.

[0262] In some embodiments, the image decompression apparatus further includes: a determining module, configured to determine the cluster center of each image acquisition object on the image and the clustering feature corresponding to each cluster center based on multiple image acquisition objects of different feature categories in the process in which the image is located; correspondingly, the clustering module 1541 is further configured to calculate the feature distance between each pixel on the image and the clustering feature corresponding to each cluster center, thereby obtaining multiple feature distances of the pixel; among the multiple feature distances, the feature category corresponding to the cluster center that satisfies the distance condition is determined as the feature category of the pixel; and a clustered image is obtained based on the feature category of each pixel on the image.

[0263] In some embodiments, the image decompression apparatus further includes: a downsampling feature extraction module, used to perform downsampling feature extraction on the clustered image based on the downsampling network in the pre-trained fully connected layer network to obtain a downsampling feature map; an upsampling feature recovery module, used to perform upsampling feature recovery on the downsampling feature map based on the upsampling network in the fully connected layer network to obtain a preprocessed image; correspondingly, the feature extraction module 1542 is also used to extract features from the preprocessed image to obtain a feature matrix.

[0264] In some embodiments, the downsampling feature extraction module is further configured to perform a first convolution process on the clustered image to obtain a first convolutional feature map; calculate the distance between each feature point on the first convolutional feature map to obtain the similarity between each feature point; based on the similarity, cluster the feature points on the first convolutional feature map to obtain multiple first feature categories; determine a feature point in each first feature category as the target feature point of the first feature category, and generate a target feature map based on the target feature point of each first feature category; and perform a second convolution process on the target feature map to obtain a downsampling feature map.

[0265] In some embodiments, the upsampling feature recovery module is further configured to perform a first transposed convolution on the downsampling feature map to obtain a second convolution feature map; the size of the convolution kernels for the first transposed convolution and the second convolution is the same; the transposed feature points in the second convolution feature map are filled to all feature points of the feature category in which the transposed feature points are located to obtain a filled feature map; the transposed feature points correspond to the target feature points; the filled feature map is subjected to a second transposed convolution to obtain a preprocessed image; the size of the convolution kernels for the second transposed convolution and the first convolution is the same.

[0266] In some embodiments, the image decompression apparatus further includes: a training module, configured to cluster pixels on sample images of the process in which the image is located, based on cluster centers, to obtain sample cluster images including multiple feature categories; perform discrete cosine transform on the sample cluster images to obtain a comparison image; input the sample cluster images into a fully connected layer network; perform downsampling feature extraction on the sample cluster images based on the downsampling network in the fully connected layer network to obtain a sample downsampling image; perform upsampling feature recovery on the sample downsampling image based on the upsampling network in the fully connected layer network to obtain a sample preprocessed image; input the sample preprocessed image and the comparison image into a second preset loss model to obtain a second loss result; and correct the model parameters in the downsampling network and the upsampling network based on the second loss result to obtain a trained fully connected layer network.

[0267] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements some or all of the steps in the above-described method. The computer-readable storage medium can be transient or non-transient.

[0268] This application provides a computer program including computer-readable code. When the computer-readable code is run in a computer device, the processor in the computer device performs some or all of the steps in the above-described method.

[0269] This application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, it implements some or all of the steps in the above-described method. This computer program product can be implemented specifically through hardware, software, or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium; in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.

[0270] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above steps / processes do not imply a sequential order of execution; the execution order of each step / 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. The sequence numbers of the above embodiments of this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0271] This application uses terms such as "upper," "lower," "top," "bottom," "front," "back," "inner," and "outer" to indicate orientation or positional relationships. This is only for the convenience of describing this application and is not intended to indicate or imply that the device referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation on the scope of protection of this application.

[0272] In the description of this application, it should also be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "joining" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in this application depending on the specific circumstances. It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device 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. For instance, multiple units or components may be combined, integrated into another system, or some features may be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed may be through some interfaces. The indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0273] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, the functional units in the embodiments of this application may all be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the integrated unit may be implemented in hardware or in a combination of hardware and software functional units.

[0274] The above are merely embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. An image decompression method, characterized in that, The image decompression method includes: Based on preset cluster centers, the pixels on the image are clustered to obtain a clustered image that includes multiple feature categories; Feature extraction is performed on the clustered image to obtain a feature matrix; the feature extraction includes at least normalizing the pixels corresponding to each feature category on the clustered image based on the normalization coefficients corresponding to each feature category on the clustered image. Based on the Gaussian distribution that the feature matrix follows, the feature matrix is ​​encoded to obtain the compressed data corresponding to the image.

2. The image decompression method according to claim 1, characterized in that, The step of extracting features from the clustered image to obtain a feature matrix includes: The clustered image is subjected to first feature extraction to obtain a first feature map; The first feature map is subjected to at least one residual processing to obtain the feature matrix; wherein the output of the previous residual processing is used as the input of the next residual processing.

3. The image decompression method according to claim 2, characterized in that, The residual processing includes: The first feature map is subjected to second feature extraction to obtain a second feature map; Determine the feature categories corresponding to the feature points in the second feature map, and calculate the mean and variance of each feature category; Based on the mean and variance of each feature category, the feature points of each feature category on the second feature map are normalized to obtain the third feature map. The first feature map and the third feature map are added together to obtain a fused feature map; The fused feature map is subjected to a nonlinear transformation to obtain the feature matrix.

4. The image decompression method according to claim 2 or 3, characterized in that, The feature extraction is implemented through an encoding network. The feature extraction of the clustered image to obtain a feature matrix includes: The clustered image is subjected to first feature extraction through the convolutional network of the encoding network to obtain a first feature map; The first feature map is subjected to at least one residual processing through at least one residual network of the encoding network to obtain the feature matrix; wherein the output of the previous residual processing is used as the input of the next residual processing.

5. The image decompression method according to claim 4, characterized in that, The residual network of the encoding network performs at least one residual processing on the first feature map to obtain the feature matrix, including: The second feature map is obtained by performing second feature extraction on the first feature map through the convolutional layer in the residual network; The feature categories corresponding to the feature points in the second feature map are determined through the normalization layer in the residual network, and the mean and variance of each feature category are calculated. Based on the mean and variance of each feature category, the feature points of each feature category in the second feature map are normalized to obtain the third feature map. The first feature map and the third feature map are added together to obtain a fused feature map; The feature matrix is ​​obtained by performing a nonlinear transformation on the fused feature map through the activation layer in the residual network.

6. The image decompression method according to any one of claims 1 to 5, characterized in that, The process of encoding the feature matrix based on the Gaussian distribution it follows to obtain compressed data corresponding to the image includes: By using an entropy coding network, the feature matrix is ​​concatenated row by row based on the row order of the feature matrix to obtain a one-dimensional feature vector; Discretize the Gaussian distribution to determine the probability and initial encoding interval of each element in the one-dimensional feature vector; According to the order of each element in the one-dimensional feature vector, based on the initial encoding interval and interval interval of the previous element, the encoding interval of the next element is determined until the encoding interval of the last element is obtained, which is used as the vector encoding interval of the one-dimensional feature vector. Any value in the vector encoding interval is determined as the target encoding result of the one-dimensional feature vector; The target encoding result is binary encoded to obtain the compressed data.

7. The image decompression method according to any one of claims 6, characterized in that, The image decompression method further includes: The compressed data is entropy decoded using an entropy decoding network to obtain a decoding feature matrix; By using a decoding network, the decoding feature matrix is ​​inversely transformed to obtain the compressed decoded image corresponding to the image.

8. The image decompression method according to claim 7, characterized in that, The entropy decoding network performs entropy decoding on the compressed data to obtain a decoding feature matrix, including: Based on the entropy decoding network, the compressed data is binary decoded to obtain the target value; Based on the initial encoding interval of each element in the entropy coding network, the encoding interval where the target value is located and the first element of the one-dimensional decoded feature vector are determined. The encoding interval containing the target value is divided based on the initial encoding interval, and the next element of the first element is determined according to the divided interval, until all elements of the one-dimensional decoded feature vector are obtained. The decoded feature matrix is ​​obtained by segmenting all elements of the one-dimensional feature vector.

9. The image decompression method according to claim 7 or 8, characterized in that, Based on the decoding network, an inverse transformation is performed on the decoding feature matrix to obtain the compressed decoded image corresponding to the image, including: The decoded feature matrix is ​​subjected to at least one decoding residual processing through at least one decoding residual network in the decoding network to obtain a decoded feature map; wherein, the at least one decoding residual network corresponds one-to-one with at least one residual network of the encoding network, and the input of the decoding residual processing is the result of adding the output of the previous decoding residual network or entropy decoding network with the output of the residual processing corresponding to the decoding residual processing; The decoded feature map is upsampled and convolved using the transposed convolutional network in the decoding network to obtain the compressed decoded image.

10. The image decompression method according to any one of claims 1 to 9, characterized in that, The image decompression method is implemented through a trained image decompression model, which includes an encoding network, an entropy encoding network, an entropy decoding network, and a decoding network. The Gaussian distribution is obtained by training the image decompression model based on sample images of the process in which the image is located. The image decompression model and the Gaussian distribution are trained in the following manner: Based on the cluster centers, the pixels on the sample images are clustered to obtain sample cluster images that include multiple feature categories; The sample clustering image is input into the image decompression model; The sample clustering image is used to extract features through the encoding network in the image decompression model to obtain the sample feature matrix; The sample feature matrix is ​​encoded using the entropy coding network and initial Gaussian distribution in the image decompression model to obtain the sample compressed data corresponding to the sample image. The sample compressed data is entropy decoded using the entropy decoding network in the image decompression model to obtain the sample decoding feature matrix. The sample decoding feature matrix is ​​inversely transformed by the decoding network in the image decompression model to obtain the sample compressed and decoded image corresponding to the sample image. The sample compressed and decoded image and the sample image are input into a first preset loss model to obtain a first loss result; Based on the first loss result, the model parameters of the encoding network, the entropy encoding network, the entropy decoding network, and the decoding network, as well as the parameters of the initial Gaussian distribution, are corrected to obtain the trained image decompression model and Gaussian distribution.

11. The image decompression method according to any one of claims 1 to 10, characterized in that, The image decompression method further includes: Based on the image acquisition objects of multiple different feature categories in the process in which the image is located, determine the cluster center of each image acquisition object on the image and the cluster features corresponding to each cluster center; Correspondingly, the step of clustering pixels in an image based on preset cluster centers to obtain clustered images with different feature categories includes: Calculate the feature distance between each pixel in the image and the cluster feature corresponding to each cluster center to obtain multiple feature distances for the pixel; Among the multiple feature distances, the feature category corresponding to the cluster center that satisfies the distance condition is determined as the feature category of the pixel; The clustered image is obtained based on the feature category of each pixel in the image.

12. The image decompression method according to any one of claims 1 to 11, characterized in that, The image decompression method further includes: Based on the downsampling network in the pre-trained fully connected layer network, downsampling feature extraction is performed on the clustered image to obtain a downsampling feature map; Based on the upsampling network in the fully connected layer network, the downsampled feature map is upsampled to restore the feature map, resulting in a preprocessed image. Correspondingly, the step of extracting features from the clustered image to obtain a feature matrix includes: Feature extraction is performed on the preprocessed image to obtain the feature matrix.

13. The image decompression method according to claim 12, characterized in that, The step of downsampling feature extraction on the clustered image to obtain a downsampling feature map includes: The clustered image is subjected to a first convolutional process to obtain a first convolutional feature map; Calculate the distance between each feature point on the first convolutional feature map to obtain the similarity between each feature point; Based on the similarity, the feature points on the first convolutional feature map are clustered to obtain multiple first feature categories; In each first feature category, a feature point is determined as the target feature point of the first feature category, and a target feature map is generated based on the target feature point of each first feature category; The target feature map is subjected to a second convolution process to obtain the downsampled feature map.

14. The image decompression method according to claim 13, characterized in that, The step of upsampling feature recovery on the downsampled feature map to obtain a preprocessed image includes: The downsampled feature map is subjected to a first transposed convolution process to obtain a second convolutional feature map; the kernel size of the first transposed convolution process and the second convolution process are the same; The transposed feature points in the second convolutional feature map are filled to all feature points of the feature category to which the transposed feature points belong, resulting in a filled feature map; the transposed feature points correspond to the target feature points. The filled feature map is subjected to a second transposed convolution process to obtain the preprocessed image; the size of the convolution kernel in the second transposed convolution process is the same as that in the first convolution process.

15. The image decompression method according to any one of claims 12 to 14, characterized in that, The fully connected layer network is trained in the following way: Based on the cluster centers, the pixels on the sample images of the process in which the image is located are clustered to obtain sample cluster images including multiple feature categories; The sample clustering images are subjected to discrete cosine transform to obtain comparison images; The sample clustering image is input into the fully connected layer network; Based on the downsampling network in the fully connected layer network, downsampling features are extracted from the sample clustering image to obtain the sample downsampling image; Based on the upsampling network in the fully connected layer network, the sample downsampled image is upsampled to restore its features, resulting in a sample preprocessed image. The preprocessed sample image and the comparison image are input into the second preset loss model to obtain the second loss result; Based on the second loss result, the model parameters in the downsampling network and the upsampling network are corrected to obtain the trained fully connected layer network.

16. An image decompression apparatus, characterized in that, The image compression device includes: The clustering module is used to cluster pixels in an image based on preset cluster centers to obtain a clustered image that includes multiple feature categories; The feature extraction module is used to extract features from the clustered image to obtain a feature matrix; the feature extraction includes at least normalizing the pixels corresponding to each feature category in the clustered image based on the normalization coefficients corresponding to each feature category in the clustered image. The encoding module is used to encode the feature matrix based on the Gaussian distribution that the feature matrix follows, so as to obtain the compressed data corresponding to the image.

17. An image decompression device, characterized in that, include: Memory, used to store executable instructions; A processor, when executing executable instructions stored in the memory, implements the steps of the image decompression method according to any one of claims 1 to 15.

18. A computer-readable storage medium, characterized in that, The device stores executable instructions for causing a processor to execute the executable instructions to implement the steps of the image decompression method according to any one of claims 1 to 15.

19. A computer program product comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by the processor, they implement the steps of the image decompression method according to any one of claims 1 to 15.