Organoid culture image compression method and system
Through deep learning, wavelet transformation and vector quantization technology, the problems of information loss and blurred details in organoid culture image compression are solved, and efficient and low-redundant image compression is achieved, which significantly improves image quality and compression efficiency.
Patent Information
- Application Number
- CN202411489750.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-10-24
AI Technical Summary
When compressing organoid culture images, existing image compression methods cannot effectively maintain the key information and quality of the image, resulting in information loss and blurred details.
Combining deep learning, wavelet transformation and vector quantization technology, through feature extraction, adaptive quantization, entropy coding and other methods, the quantization step size and number of codebook vectors are dynamically adjusted, and the codeword allocation strategy in the entropy coding process is optimized to generate efficient and low-quality Redundant compressed files.
It realizes efficient and high-quality compression of organoid culture images, accurately retains key biological characteristics, reduces storage and transmission costs, and avoids the problems of information loss and fuzzy details in traditional methods.
Smart Images

Figure CN119011837B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image compression, and in particular to an organoid culture image compression method and a system thereof. Background Art
[0002] With the rapid development of life sciences, organoid culture technology has become an important tool for studying the complex functions of organisms, disease mechanisms, and drug screening. As an important part of this technology, organoid culture images contain rich biological information and are of great value to scientific researchers. However, these images are usually characterized by high resolution and large amounts of data, which poses great challenges to storage and transmission.
[0003] Traditional image compression methods, such as JPEG and PNG, can reduce image storage space to a certain extent, but often at the expense of image quality, which may cause irreversible loss of fine structures and key information in organoid culture images. Therefore, it is particularly important to develop an organoid culture image compression method that can effectively compress image data while maintaining key image information.
[0004] At present, although there are some compression algorithms for images in specific fields, these algorithms often lack special optimization for the characteristics of organoid culture images and cannot achieve efficient compression while ensuring image quality.
[0005] Therefore, it is necessary to provide an organoid culture image compression method and system to solve the above technical problems. Summary of the invention
[0006] In order to solve the above technical problems, the present invention provides an organoid culture image compression method and system, which realizes efficient compression of organoid culture images while maintaining the key information of the image by combining deep learning, wavelet transform and vector quantization.
[0007] The present invention provides an organoid culture image compression method, the compression method comprising the following steps:
[0008] Using a pre-trained feature extraction model to perform feature extraction on the input organoid culture image, and performing a first adaptive quantization on each feature block in the extracted first feature map to obtain a second feature map;
[0009] Performing frequency domain conversion on the second feature map using a wavelet transform algorithm, and performing second adaptive quantization on the coefficients after the frequency domain conversion to obtain quantization coefficients and corresponding second quantization step sizes;
[0010] Clustering the quantized coefficients into a set of codebook vectors, and assigning a unique codebook index to each codebook vector;
[0011] Entropy coding is performed on the codebook indexes of all codebook vectors, and codeword allocation is optimized to generate entropy coded codewords;
[0012] All the entropy-encoded codewords are integrated to generate a compressed file of the organoid culture image, wherein the compressed file includes a codebook vector and a corresponding codeword.
[0013] Preferably, the method of extracting features from the input organoid culture image using a pre-trained feature extraction model and performing a first adaptive quantization on each feature block in the extracted first feature map to obtain a second feature map comprises:
[0014] Train and generate feature extraction models based on deep learning networks;
[0015] Taking the organoid culture image as input, performing multi-layer convolution processing through the feature extraction model, extracting image features in the organoid culture image, and forming a first feature map;
[0016] Dividing the first feature map into a plurality of feature map blocks in a sliding window manner;
[0017] In the first feature map, a first adaptive quantization is performed on each feature map block, wherein the first adaptive quantization is to dynamically adjust a first quantization step size according to a gradient value of the feature map block to obtain a second feature map.
[0018] Preferably, the using of a wavelet transform algorithm to perform frequency domain conversion on the second feature map, and performing second adaptive quantization on the coefficients after the frequency domain conversion to obtain quantization coefficients and corresponding second quantization step sizes, comprises:
[0019] Using a wavelet transform algorithm to transform the second feature map from the spatial domain to the frequency domain to obtain a wavelet coefficient set, wherein the wavelet coefficient set contains different frequency components of the organoid culture image;
[0020] The wavelet coefficient set after the frequency domain conversion is subjected to a second adaptive quantization to obtain the quantization coefficient and a corresponding second quantization step size.
[0021] Preferably, clustering the quantization coefficients into a group of codebook vectors and assigning a unique codebook index to each codebook vector comprises:
[0022] Calculating the weight of the quantization coefficient, wherein the weight is a statistical value of the quantization coefficient, wherein the statistical value is a normalized value of a mean and a variance of the quantization coefficient;
[0023] Based on the weights of the quantization coefficients, dynamically adjusting the number of required codebook vectors according to a pre-constructed mapping table;
[0024] The quantization coefficients are clustered into a group of codebook vectors according to the adjusted number of codebook vectors using a pre-trained vector quantizer, and a unique codebook index is assigned to each codebook vector.
[0025] Preferably, performing entropy coding on the codebook indexes of all codebook vectors and optimizing codeword allocation to generate entropy coded codewords includes:
[0026] Performing preliminary entropy coding on the codebook indexes of all codebook vectors to form preliminary coded codewords;
[0027] Calculate the average of the first quantization step length and the second quantization step length to obtain an average quantization step length;
[0028] Based on the average quantization step size, dynamically adjusting a codeword allocation strategy in an entropy coding process, wherein in the codeword allocation strategy, the average quantization step size is negatively correlated with the redundancy of the codeword allocation;
[0029] According to the adjusted codeword allocation strategy, the initially encoded codewords are optimized to generate final entropy-encoded codewords.
[0030] Preferably, the step of integrating all the entropy-encoded codewords to generate a compressed file of the organoid culture image, wherein the compressed file includes a codebook vector and corresponding codewords, including:
[0031] sorting the entropy-encoded codewords according to their spatial positions in the organoid culture image;
[0032] Associating the sorted entropy coded codewords with the corresponding codebook vectors to form a data set including the codebook vectors and the corresponding codewords;
[0033] The data set is compressed using a compression algorithm, and the compressed data set is packaged into a standard file format to generate a compressed file of the organoid culture image.
[0034] The present invention also provides an organoid culture image compression system, which is used to execute the organoid culture image compression method. The compression system comprises:
[0035] A feature extraction module, used to extract features from the input organoid culture image using a pre-trained feature extraction model, and perform a first adaptive quantization on each feature block in the extracted first feature map to obtain a second feature map;
[0036] A frequency domain conversion module, used to perform frequency domain conversion on the second feature map using a wavelet transform algorithm, and perform a second adaptive quantization on the coefficients after the frequency domain conversion to obtain a quantization coefficient and a corresponding second quantization step size;
[0037] A vectorization module, configured to cluster the quantization coefficients into a set of codebook vectors and assign a unique codebook index to each codebook vector;
[0038] An entropy coding module, used to perform entropy coding on the codebook indexes of all codebook vectors, optimize codeword allocation, and generate entropy coded codewords;
[0039] The compression generation module is used to integrate all the code words after entropy coding to generate a compressed file of the organoid culture image, wherein the compressed file includes a codebook vector and a corresponding code word.
[0040] Compared with the related art, the organoid culture image compression method and system provided by the present invention have the following beneficial effects:
[0041] The organoid culture image compression method proposed in the present invention achieves efficient and high-quality compression of organoid culture images by comprehensively using advanced technologies such as deep learning feature extraction, wavelet transform frequency domain analysis, adaptive quantization, vector quantization and entropy coding, showing significant overall beneficial effects.
[0042] Specifically, this method can accurately capture and retain the key biological features in organoid culture images, effectively avoiding the image information loss and detail blurring that may be caused by traditional compression methods. At the same time, by dynamically adjusting the quantization step size and the number of codebook vectors, and optimizing the codeword allocation strategy in the entropy coding process, the present invention significantly reduces the redundancy of image data, achieves efficient data compression, and reduces storage and transmission costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A flow chart of an organoid culture image compression method provided by the present invention;
[0044] Figure 2 This is a module structure diagram of an organoid culture image compression system provided by the present invention. DETAILED DESCRIPTION
[0045] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only the parts related to the present invention, rather than all structures, are shown in the accompanying drawings. In addition, the embodiments of the present invention and the features in the embodiments may be combined with each other without conflict.
[0046] It should also be noted that, for ease of description, only the parts related to the present invention, but not all of the contents, are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the operations (or steps) as sequential processes, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to methods, functions, procedures, subroutines, subprograms, etc.
[0047] Embodiment 1
[0048] The present invention provides an organoid culture image compression method, referring to Figure 1 As shown, the compression method comprises the following steps:
[0049] S1: Use a pre-trained feature extraction model to extract features of the input organoid culture image, and perform a first adaptive quantization on each feature block in the extracted first feature map to obtain a second feature map.
[0050] Specifically, step S1 specifically includes the following steps:
[0051] S11: Train and generate feature extraction models based on deep learning networks.
[0052] In this embodiment, the deep learning network is widely used due to its powerful feature extraction capability. Through the pre-trained deep learning model, high-level features in the image can be efficiently extracted, thus providing a basis for subsequent quantization and compression.
[0053] Specifically, a pre-trained convolutional neural network (CNN) model is used as the feature extraction model. This model has been pre-trained on a large-scale dataset and has good generalization and feature extraction capabilities. The specific steps are as follows:
[0054] Select a pre-trained CNN model suitable for image feature extraction, including but not limited to VGG, ResNet, and MobileNet, and load the weights and structure of the pre-trained model.
[0055] S12: Taking the organoid culture image as input, performing multi-layer convolution processing through the feature extraction model, extracting image features in the organoid culture image, and forming a first feature map.
[0056] In this embodiment, multi-level features in the image can be extracted through multi-layer convolution processing, thereby providing high-quality feature representation for subsequent quantization and compression.
[0057] Specifically, the organoid culture image is used as input and multi-layer convolution processing is performed through the pre-trained feature extraction model. The specific steps are as follows:
[0058] The input organoid culture images are normalized to meet the requirements of the pre-trained model.
[0059] The processed image is input into the pre-trained CNN model, and multi-level features in the image are extracted through multi-layer convolution and pooling operations.
[0060] The generated first feature map contains a large number of high-level features, which provides a basis for subsequent quantization.
[0061] S13: Divide the first feature map into multiple feature map blocks in a sliding window manner.
[0062] During image compression, splitting the feature map into multiple tiles can better capture local features and perform refined quantization.
[0063] Specifically, the first feature map is divided into multiple feature map blocks in a sliding window manner. The specific steps are as follows:
[0064] First, the size of the sliding window is defined according to the resolution of the image and the degree of detail that needs to be captured. Then, the window is slid along the width and height of the feature map at a set step size to split the feature map into multiple overlapping feature blocks. Finally, the segmented feature blocks are stored to prepare for the next step of quantization.
[0065] S14: In the first feature map, a first adaptive quantization is performed on each feature map block, wherein the first adaptive quantization is to dynamically adjust a first quantization step size according to a gradient value of the feature map block to obtain a second feature map.
[0066] In this embodiment, adaptive quantization can adjust the quantization step size according to different regions of the image, thereby improving compression efficiency while ensuring image quality.
[0067] Specifically, each feature block is subjected to the first adaptive quantization, and the specific steps are as follows:
[0068] The gradient value of each feature block is calculated, and the gradient value reflects the intensity of image edges and details.
[0069] The first quantization step size is dynamically adjusted according to the gradient value. A smaller first quantization step size is used in an area with a large gradient value, and a larger first quantization step size is used in an area with a small gradient value.
[0070] Each feature map block is quantized to obtain a second feature map, which retains key features and has controllable quantization errors.
[0071] S2: Perform frequency domain conversion on the second feature map using a wavelet transform algorithm, and perform a second adaptive quantization on the coefficients after the frequency domain conversion to obtain quantization coefficients and corresponding second quantization step sizes.
[0072] Specifically, step S2 specifically includes the following steps:
[0073] S21: Using a wavelet transform algorithm, the second feature map is converted from the spatial domain to the frequency domain to obtain a wavelet coefficient set, wherein the wavelet coefficient set includes different frequency components of the organoid culture image.
[0074] Among them, wavelet transform is a method for analyzing signals. It can decompose signals into different frequency components and has good localization characteristics. It can provide local information in time as well as local information in frequency.
[0075] In this embodiment, according to the characteristics of organoid culture images, the Daubechies wavelet basis function is selected, which has good time-frequency locality.
[0076] Three layers of wavelet transform are performed, and each layer of transform produces an approximate coefficient matrix (representing low-frequency information) and three detail coefficient matrices (high-frequency information in the horizontal, vertical and diagonal directions).
[0077] Using the Discrete Wavelet Transform (DWT) algorithm, the second feature map is transformed in two dimensions, which usually involves dividing the image into four sub-bands: an approximate sub-band (LL) and three detail sub-bands (LH, HL, HH), representing low frequency, horizontal high frequency, vertical high frequency and diagonal high frequency information respectively.
[0078] After the transformation is completed, a set of wavelet coefficients is obtained, which includes coefficient matrices of different frequency components. These coefficients can be used to reconstruct the original image and also provide a basis for the subsequent quantization steps.
[0079] S22: Perform a second adaptive quantization on the wavelet coefficient set after frequency domain conversion to obtain a quantization coefficient and a corresponding second quantization step size.
[0080] In this embodiment, the distribution of the wavelet coefficient set obtained by wavelet transform is analyzed, and the distribution characteristics of the coefficients can be understood by calculating the histogram of each sub-band.
[0081] According to the characteristics of coefficient distribution, a suitable second quantization step size is determined for each sub-band. For high-frequency sub-bands, since they have less impact on the human visual system, a larger second quantization step size can be used to reduce the amount of data; while for low-frequency sub-bands, a smaller second quantization step size is required to retain more detail information.
[0082] For each wavelet coefficient, the corresponding quantization step is used for quantization. The quantization process can be expressed as ,in, is the quantized coefficient, are the original wavelet coefficients, is the second quantization step size for the coefficient, Indicates a rounding operation.
[0083] During the quantization process, the second quantization step size used for each subband needs to be recorded so that it can be correctly inverse quantized during the decoding stage.
[0084] S3: Cluster the quantized coefficients into a set of codebook vectors, and assign a unique codebook index to each codebook vector.
[0085] Specifically, step S3 specifically includes the following steps:
[0086] S31: Calculate the weight of the quantization coefficient, where the weight is a statistical value of the quantization coefficient, where the statistical value is a normalized value of the mean and variance of the quantization coefficient.
[0087] In this embodiment, all quantization coefficients obtained from step S2 are obtained, and for each quantization coefficient set (i.e., each subband of the wavelet transform), the variance is calculated simultaneously, which reflects the degree of dispersion of the coefficient set, and the mean and variance are converted into weights. A linear transformation can be used here to ensure that the weight value is within a certain range (such as between 0 and 1).
[0088] S32: Based on the weights of the quantization coefficients, dynamically adjust the number of required codebook vectors according to a pre-constructed mapping table.
[0089] In this embodiment, the number of codebook vectors is determined according to the calculated weight distribution based on a pre-constructed mapping table of weights and the number of codebook vectors. The mapping table may be a set of rules designed based on experience or experimental data, indicating how many codebook vectors should be used under different weight distribution conditions.
[0090] One or more thresholds are set to decide when to increase or decrease the number of codebook vectors. For example, if the weights of most coefficients are higher than a certain threshold, more codebook vectors are needed to represent these coefficients; otherwise, they can be reduced.
[0091] The number of codebook vectors actually used is determined based on threshold judgment and weight distribution.
[0092] S33: using a pre-trained vector quantizer, clustering the quantization coefficients into a group of codebook vectors according to the adjusted number of codebook vectors, and assigning a unique codebook index to each codebook vector.
[0093] In this embodiment, a pre-trained vector quantizer is loaded and its parameters are set, including the number of codebook vectors to be used.
[0094] The quantized coefficients are input into the vector quantizer for clustering. The vector quantizer divides the coefficients into the closest codebook vectors.
[0095] Each codebook vector is assigned a unique index number, which can be represented by an integer. After clustering, each quantized coefficient will be replaced by the index number of the codebook vector to which it belongs.
[0096] Output the clustered index sequence, which will be used in the subsequent entropy encoding step.
[0097] S4: Entropy coding is performed on the codebook indexes of all codebook vectors, and codeword allocation is optimized to generate entropy coded codewords.
[0098] Specifically, step S4 specifically includes the following steps:
[0099] S41: Perform preliminary entropy coding on the codebook indexes of all codebook vectors to form preliminary coded codewords.
[0100] In this embodiment, the occurrence frequencies of all codebook indexes, that is, the number of times each codebook index appears in the image, are counted, and a frequency table is established to record each codebook index and its corresponding frequency.
[0101] Select an entropy coding method, including but not limited to Huffman coding or arithmetic coding. Here, Huffman coding is taken as an example.
[0102] Generate a Huffman tree based on the frequency table. The specific steps are as follows:
[0103] Considering all codebook indices and their frequencies as leaf nodes, a priority queue (min heap) is constructed, where the priority is determined by the frequency.
[0104] Each time, the two nodes with the smallest frequency are taken out of the queue, and a new internal node is created with a frequency equal to the sum of the frequencies of the two child nodes, and then the new node is reinserted into the queue.
[0105] Repeat the above steps until only one node remains, which is the root node of the Huffman tree.
[0106] Traverse the Huffman tree from the root node to each leaf node, record the path passed (left branch is recorded as 0, right branch is recorded as 1), and thus obtain the codeword of each codebook index.
[0107] The generated codeword is used to encode all codebook indexes to form a preliminarily encoded codeword.
[0108] S42: Calculate the average of the first quantization step size and the second quantization step size to obtain an average quantization step size.
[0109] In this embodiment, the first quantization step length obtained from step S1 and the second quantization step length obtained from step S2 are collected, and the average value of the first quantization step length and the second quantization step length is calculated to obtain the average quantization step length.
[0110] S43: dynamically adjusting the codeword allocation strategy in the entropy coding process based on the average quantization step size, wherein in the codeword allocation strategy, the average quantization step size is negatively correlated with the redundancy of the codeword allocation.
[0111] In this embodiment, the redundancy of codeword allocation is determined according to the average quantization step length. The redundancy reflects the relationship between the codeword length and the quantization step length.
[0112] In the codeword allocation strategy, the average quantization step size is negatively correlated with the redundancy of codeword allocation. This means that when the average quantization step size is larger, more redundancy can be allowed, that is, longer codewords are used to represent less frequent codebook indices, and when the average quantization step size is smaller, redundancy should be reduced, that is, shorter codewords are used to represent more frequent codebook indices.
[0113] The codeword length is reallocated according to the adjusted redundancy, and the Huffman tree can be regenerated or the existing codeword length can be adjusted.
[0114] S44: Optimizing the initially encoded codewords according to the adjusted codeword allocation strategy to generate final entropy-encoded codewords.
[0115] In this embodiment, the adjusted codeword allocation strategy is used to re-optimize the codewords after preliminary encoding, and the codebook index is re-encoded according to the new codeword allocation strategy to generate the final entropy-encoded codewords to verify whether the optimized codewords have indeed improved the compression efficiency, reduced redundancy, and maintained image quality.
[0116] S5: Integrate all the entropy-encoded codewords to generate a compressed file of the organoid culture image, wherein the compressed file includes a codebook vector and a corresponding codeword.
[0117] Specifically, step S5 specifically includes the following steps:
[0118] S51: Sort the entropy-encoded codewords according to their spatial positions in the organoid culture image.
[0119] In this embodiment, all the codewords after entropy coding are collected and their position information in the original image is recorded, which involves recording the position of the feature block corresponding to each codebook index.
[0120] Create a data structure (including but not limited to a list or array) to store each codeword and its corresponding spatial location information.
[0121] Sort the codewords according to their positions in the original image. This can be done using any effective sorting algorithm (including but not limited to quick sort and merge sort), the goal of which is to ensure that the codewords are arranged in the order they appear in the image.
[0122] S52: Associating the sorted entropy coded codewords with the corresponding codebook vectors to form a data set including the codebook vectors and the corresponding codewords.
[0123] In this embodiment, a new data structure (including but not limited to a dictionary or a list) is created to store the sorted codewords and their corresponding codebook vectors.
[0124] Iterate through the sorted list of codewords and associate each codeword with its corresponding codebook vector. This usually involves storing the codewords and codebook vectors together in a data structure.
[0125] S53: compressing the data set using a compression algorithm, and encapsulating the compressed data set into a standard file format to generate a compressed file of the organoid culture image.
[0126] In this embodiment, a suitable compression algorithm is selected to further compress the associated data set, wherein the compression algorithm includes but is not limited to GZIP, BZIP2, and LZMA.
[0127] Compress the associated dataset using the selected compression algorithm.
[0128] The compressed data is packaged into a standard file format, such as .zip, .gz or other applicable formats. In addition, necessary metadata, such as the encoding method used, quantization step size, and other information, need to be added to the file header for use during decoding.
[0129] The working principle of the organoid culture image compression method and system provided by the present invention is as follows:
[0130] First, the input organoid culture image is feature extracted using a pre-trained feature extraction model. The feature extraction model is based on a deep learning network and extracts key features from the image through multi-layer convolution processing to form a first feature map. Then, the first feature map is divided into multiple feature blocks in a sliding window manner, and each feature block is subjected to a first adaptive quantization. The adaptive quantization here dynamically adjusts the quantization step size according to the gradient value of the feature block to retain more image detail information and obtain a second feature map.
[0131] Next, the second feature map is converted from the spatial domain to the frequency domain using the wavelet transform algorithm to obtain a set of wavelet coefficients containing different frequency components. The wavelet coefficient set is subjected to a second adaptive quantization to obtain the quantization coefficients and the corresponding quantization step size. This step aims to further reduce the redundancy of the data while retaining the main frequency components of the image.
[0132] Then, the quantized coefficients are clustered into a set of codebook vectors and each codebook vector is assigned a unique codebook index. This step dynamically adjusts the number of required codebook vectors by calculating the weights of the quantized coefficients and clustering them using a pre-trained vector quantizer. This can further reduce the storage space of the data while maintaining the main features of the image.
[0133] Then, the codebook indexes of all codebook vectors are entropy encoded to form the preliminarily encoded codewords. Then, the average of the first quantization step size and the second quantization step size is calculated, and the codeword allocation strategy in the entropy encoding process is dynamically adjusted based on the average. This step aims to optimize the allocation of codewords, reduce redundancy in the encoding process, and improve compression efficiency.
[0134] Finally, the codewords after entropy coding are sorted according to their spatial positions in the organoid culture image and associated with the corresponding codebook vectors to form a data set containing the codebook vectors and the corresponding codewords. The data set is compressed using a compression algorithm and encapsulated into a standard file format to generate a compressed file of the organoid culture image.
[0135] Embodiment 2
[0136] The present invention also provides an organoid culture image compression system for executing an organoid culture image compression method, referring to Figure 2 As shown, the compression system includes:
[0137] The feature extraction module 100 is used to extract features from the input organoid culture image using a pre-trained feature extraction model, and perform a first adaptive quantization on each feature block in the extracted first feature map to obtain a second feature map.
[0138] The frequency domain conversion module 200 is used to perform frequency domain conversion on the second feature map using a wavelet transform algorithm, and perform a second adaptive quantization on the coefficients after the frequency domain conversion to obtain quantization coefficients and corresponding second quantization step sizes.
[0139] The vectorization module 300 is used to cluster the quantization coefficients into a group of codebook vectors and assign a unique codebook index to each codebook vector.
[0140] The entropy coding module 400 is used to perform entropy coding on the codebook indexes of all codebook vectors, optimize codeword allocation, and generate entropy coded codewords.
[0141] The compression generation module 500 is used to integrate all the code words after entropy coding to generate a compressed file of the organoid culture image, wherein the compressed file includes a code book vector and a corresponding code word.
[0142] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0143] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, the storage medium including a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically-erasable programmable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0144] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
Claims
1. A method for compressing organoid culture images, characterized in that: The compression method comprises the following steps: Using a pre-trained feature extraction model to perform feature extraction on the input organoid culture image, and performing a first adaptive quantization on each feature block in the extracted first feature map to obtain a second feature map and a first quantization step size; Performing frequency domain conversion on the second feature map using a wavelet transform algorithm, and performing second adaptive quantization on the coefficients after the frequency domain conversion to obtain quantization coefficients and corresponding second quantization step sizes; Clustering the quantized coefficients into a set of codebook vectors, and assigning a unique codebook index to each codebook vector; Entropy coding is performed on the codebook indexes of all codebook vectors, and codeword allocation is optimized to generate entropy coded codewords; The entropy coding of the codebook indexes of all codebook vectors and optimizing the codeword allocation to generate the entropy coded codewords includes: Performing preliminary entropy coding on the codebook indexes of all codebook vectors to form preliminary coded codewords; Calculate the average of the first quantization step length and the second quantization step length to obtain an average quantization step length; Based on the average quantization step size, dynamically adjusting a codeword allocation strategy in an entropy coding process, wherein in the codeword allocation strategy, the average quantization step size is negatively correlated with the redundancy of the codeword allocation; According to the adjusted codeword allocation strategy, the codewords after preliminary encoding are optimized to generate the final entropy encoded codewords; Integrating all the entropy-encoded codewords to generate a compressed file of the organoid culture image, wherein the compressed file includes a codebook vector and a corresponding codeword; The step of integrating all the entropy-encoded codewords to generate a compressed file of the organoid culture image, wherein the compressed file includes a codebook vector and corresponding codewords, including: sorting the entropy-encoded codewords according to their spatial positions in the organoid culture image; Associating the sorted entropy coded codewords with the corresponding codebook vectors to form a data set including the codebook vectors and the corresponding codewords; The data set is compressed using a compression algorithm, and the compressed data set is packaged into a standard file format to generate a compressed file of the organoid culture image.
2. The organoid culture image compression method according to claim 1, characterized in that: The method of extracting features from the input organoid culture image using a pre-trained feature extraction model and performing a first adaptive quantization on each feature block in the extracted first feature map to obtain a second feature map comprises: Train and generate feature extraction models based on deep learning networks; Taking the organoid culture image as input, performing multi-layer convolution processing through the feature extraction model, extracting image features in the organoid culture image, and forming a first feature map; Dividing the first feature map into a plurality of feature map blocks in a sliding window manner; In the first feature map, a first adaptive quantization is performed on each feature map block, wherein the first adaptive quantization is to dynamically adjust a first quantization step size according to a gradient value of the feature map block to obtain a second feature map.
3. The organoid culture image compression method according to claim 2, characterized in that: The method of performing frequency domain conversion on the second feature map by using a wavelet transform algorithm, and performing second adaptive quantization on the coefficients after the frequency domain conversion to obtain quantization coefficients and corresponding second quantization step sizes includes: Using a wavelet transform algorithm to transform the second feature map from the spatial domain to the frequency domain to obtain a wavelet coefficient set, wherein the wavelet coefficient set contains different frequency components of the organoid culture image; The wavelet coefficient set after the frequency domain conversion is subjected to a second adaptive quantization to obtain the quantization coefficient and a corresponding second quantization step size.
4. The organoid culture image compression method according to claim 3, characterized in that: The clustering of the quantization coefficients into a group of codebook vectors and assigning a unique codebook index to each codebook vector comprises: Calculating the weight of the quantization coefficient, wherein the weight is a statistical value of the quantization coefficient, wherein the statistical value is a normalized value of a mean and a variance of the quantization coefficient; Based on the weights of the quantization coefficients, dynamically adjusting the number of required codebook vectors according to a pre-constructed mapping table; The quantization coefficients are clustered into a group of codebook vectors according to the adjusted number of codebook vectors using a pre-trained vector quantizer, and a unique codebook index is assigned to each codebook vector.
5. An organoid culture image compression system, used to execute an organoid culture image compression method according to any one of claims 1 to 4, characterized in that: The compression system comprises: A feature extraction module, used to extract features from the input organoid culture image using a pre-trained feature extraction model, and perform a first adaptive quantization on each feature block in the extracted first feature map to obtain a second feature map; A frequency domain conversion module, used to perform frequency domain conversion on the second feature map using a wavelet transform algorithm, and perform a second adaptive quantization on the coefficients after the frequency domain conversion to obtain a quantization coefficient and a corresponding second quantization step size; A vectorization module, configured to cluster the quantization coefficients into a set of codebook vectors and assign a unique codebook index to each codebook vector; An entropy coding module, used to perform entropy coding on the codebook indexes of all codebook vectors, optimize codeword allocation, and generate entropy coded codewords; The compression generation module is used to integrate all the code words after entropy coding to generate a compressed file of the organoid culture image, wherein the compressed file includes a codebook vector and a corresponding code word.