A database image data storage method and system based on layered sparse coding

Through the method based on hierarchical sparse encoding, the image is evaluated without reference and feature extraction, and the super-complete dictionary is constructed, which solves the problems of low efficiency and high memory footprint when storing image data in the database, and realizes efficient storage and reconstruction.

CN118585661BActive Publication Date: 2024-11-12NAT UNIV OF DEFENSE TECH
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411068263.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-11-12
Estimated Expiration
2044-08-06

AI Technical Summary

Technical Problem

Existing databases have problems such as inefficiency and excessive memory usage when storing and processing image data, especially when processing large amounts of binary image data, and the database cannot read data after the image data path changes, which affects the processing speed.

Method used

Using a hierarchical sparse encoding method, the image is evaluated without reference image quality. The super-complete dictionary is constructed using deep learning sparse autoencoder, K-SVD algorithm and 3D self-organization mapping algorithm to parse the image data into address codes and Atomic unit storage, enabling efficient storage and reconstruction.

Benefits of technology

It improves the efficiency of the database storing and processing image data, reduces memory usage, avoids the problem that the database cannot read data after image data path changes, and supports high-definition image storage without binary conversion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118585661B_ABST
    Figure CN118585661B_ABST
Patent Text Reader

Abstract

The present invention proposes a database image data storage method and system based on hierarchical sparse coding, which belongs to the technical field of image data storage. The present invention performs a reference-free image quality assessment on the input image to judge the image quality, and then, based on the judged image quality result, uses a sparse autoencoder based on deep learning, a K-SVD algorithm, and a 3D self-organizing mapping algorithm to extract features for high-resolution image data, image data with clear contours, and low-resolution image data, respectively, to construct an over-complete dictionary, and stores the over-complete dictionary in the database; in addition, the performance of the over-complete dictionary is tested based on the structural similarity calculation results of the reconstructed image of the test set, so that the image can restore the original image data in the over-complete dictionary according to the address code, which is convenient for database storage and can also reduce the memory occupancy rate to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image data storage, and in particular to a database image data storage method and system based on hierarchical sparse coding. Background Art

[0002] 1. Database

[0003] A database is a "warehouse that collects, stores and manages data based on its structure". It is a massive data set that can be stored in a computer periodically, stored by category and centrally managed. Different databases can store different amounts of data, ranging from millions to billions. Different databases have corresponding rules for storing data, which are usually stored and managed based on the structure of the data. The types of data stored mainly include text data, image and video data, sound data, etc.

[0004] The current mainstream database types include relational databases (SQL) and non-relational databases (NoSQL). The main differences between the two are:

[0005] (1) Different storage methods: Relational databases store data in the form of tables, which can intuitively reflect the relationship between entities; non-relational databases store data in the form of data sets and have no unified standards.

[0006] (2) Different storage structures: Relational databases store data in a structured form, requiring each field in the table to be defined in advance, but it is relatively complicated to modify the structure later; non-relational databases use dynamic forms to store knowledge and can flexibly adjust the structure of the stored data.

[0007] (3) Different storage specifications: Relational databases store data in the form of minimum relational tables. As the amount of data continues to increase, centralized management tasks will become very complicated. Non-relational databases store data in a centralized form, with separate databases storing data independently to facilitate data reading and writing. However, this process may cause excessive storage space to be occupied due to duplicate data storage.

[0008] (4) Different expansion methods: Relational databases use the SQL language for data query, support adding, querying, and deleting data in the database, and quickly query data by index; non-relational databases use the UNAL language for data query, and data query rules are more convenient than SQL.

[0009] 2. Database image data storage method

[0010] There are two main ways to store image data in a database. One is to store the image data locally and then store the path to the stored data in the database; the other is to convert the image data into binary form and store it in the database.

[0011] (1) Storage path method

[0012] This method usually stores image data in a local folder according to the time (year, month, day) rule, and then stores the corresponding path in the database. The disadvantage is that when the local image data path changes, the corresponding data cannot be obtained according to the path previously stored in the database; at the same time, when the number of files is large, the database will be slow to obtain data, affecting processing efficiency.

[0013] (2) Convert to binary form

[0014] This method converts image data into binary byte stream for storage. The database supports data in two forms: BLOB and CLOB. In the specific operation process, the image data is first converted into a binary stream for storage, and then the binary stream in the database is restored when it is needed. However, the disadvantage of this storage method is that the stored image cannot be too large. In the Internet environment, the operating speed and performance requirements of the database are relatively high. Usually, the memory occupied by an image ranges from 1M to tens of M. Converting each image into a binary stream and storing it in the database will increase the burden on the database and affect the processing speed. When the database needs to be backed up, the large amount of stored image data also needs to be backed up, which takes a long time.

[0015] 3. Sparse Coding

[0016] Image sparse coding (ISC) is used to express the sparseness of signals. On the premise of training an overcomplete dictionary, the stored signal is sparsely coded with as few atoms as possible to achieve efficient coding and processing effects. The main work of sparse expression of signals is the generation of overcomplete dictionaries and sparse decomposition of signals. The current mainstream analysis dictionary construction methods include overcomplete DCT transform, discrete wavelet transform, curvelet transform, and multi-scale geometric analysis dictionary construction methods. Such dictionary construction is simple, the signal decomposition calculation process does not involve matrix transformation, the representation form of the signal is single, it is not easy to update and iterate, and the signal decoding effect is relatively poor; learning dictionaries include FOCUSS dictionary learning method, MOD dictionary learning, and generalized principal component analysis (PCA) dictionary learning algorithm. Such dictionary learning algorithms can adaptively update the learning dictionary and converge quickly, but as the amount of data increases, the noise increases, and some information will be lost in the decoding of the signal, resulting in unclear decoding effect.

[0017] The dictionary is composed of atomic units to express the signal sparsely and construct a sparse model, which simplifies the complex mathematical coding process and reduces the signal data coding processing work to a certain extent. The current signal sparse coding work is completed in two forms: signal sparse decomposition algorithm and dictionary construction algorithm based on sparse coding. The representative algorithm of signal sparse decomposition algorithm is greedy algorithm, and the representative algorithm of dictionary construction algorithm based on sparse coding is K-singular value algorithm.

[0018] In the process of image sparse decomposition based on the greedy algorithm, the best atoms are orthogonalized in each update to ensure that the workload of atom matching is reduced during the decomposition process and the update speed is increased. However, as the number of atoms continues to increase, the workload of Schmidt orthogonalization calculation increases, and the overall calculation difficulty also increases.

[0019] In the signal sparse coding and dictionary construction work based on the K-singular value algorithm, K-SVD aims to construct an overcomplete dictionary, calculate the optimal solution as the sparse coefficient and combine the overcomplete dictionary to complete the sparse representation of the signal. The algorithm process first updates the atoms column by column to obtain the sparsest coefficient, and completes the dictionary construction through two stages of dictionary initialization and dictionary update. Although this algorithm is an effective dictionary construction method, updating each atom can retain the unique characteristics of the sample. However, this algorithm can ensure local optimality in the sparse representation process. Image coding requires obtaining the global optimal solution. In actual application, it needs to be combined with a greedy algorithm, and the calculation process is complicated. Summary of the invention

[0020] In view of the above technical problems, the present invention proposes a database image data storage solution based on layered sparse coding.

[0021] In a first aspect, the present invention provides a database image data storage method based on hierarchical sparse coding. The method comprises:

[0022] Step S1, performing data preprocessing on the L images in the training set after cleaning and deduplication, wherein the data preprocessing is to perform block processing on the L images in the training set;

[0023] The block cutting process evenly divides each of the L images into k image blocks, obtaining a total of L×k image blocks, and there is no overlap between the image blocks;

[0024] Step S2, performing a reference-free image quality assessment on the L×k image blocks obtained after the block processing, thereby classifying the L images;

[0025] The L images are divided into a first type of image, a second type of image, and a third type of image; the resolution of the first type of image is higher than a first threshold, the resolution of the second type of image is not higher than the first threshold and higher than a second threshold, the resolution of the third type of image is not higher than the second threshold, and the first threshold is greater than the second threshold;

[0026] Step S3, constructing a first original dictionary, a second original dictionary, and a third original dictionary based on the first category of images, the second category of images, and the third category of images respectively;

[0027] Step S4, respectively using an autoencoder based on deep learning, a K-SVD algorithm, and a 3D self-organizing map algorithm to learn the first original dictionary, the second original dictionary, and the third original dictionary to obtain a first super-complete dictionary, a second super-complete dictionary, and a third super-complete dictionary;

[0028] Step S5, combining the first overcomplete dictionary, the second overcomplete dictionary, and the third overcomplete dictionary into an overcomplete dictionary, reconstructing the images in the test set based on the overcomplete dictionary, and calculating the structural similarity between the reconstructed images and the images in the test set;

[0029] When the structural similarity is higher than the similarity discrimination threshold, the dictionary learning process is stopped, and an over-complete dictionary after learning optimization is obtained;

[0030] Step S6: using the overcomplete dictionary after learning and optimization to obtain the address code of the image to be stored, storing the image to be stored based on the address code, and reconstructing the stored image based on the address code.

[0031] According to the method of the first aspect of the present invention, in step S2, performing no-reference image quality assessment on the image block specifically includes:

[0032] For each of the L images, each of the k image blocks obtained after the image is segmented is processed as follows: the grayscale average value of all pixels is calculated, the grayscale value of each pixel is subtracted by the grayscale average value and then the square sum is calculated, and all pixels are standardized; the greater the change in pixel grayscale, the higher the resolution; otherwise, the lower the resolution;

[0033] The number of image blocks with a resolution greater than a first threshold, the number of image blocks with a resolution not higher than the first threshold and higher than a second threshold, and the number of image blocks with a resolution not higher than the second threshold are counted among the k image blocks of the image, and a classification result of the image is obtained according to the number of image blocks obtained by counting.

[0034] According to the method of the first aspect of the present invention, in step S3:

[0035] Constructing the first original dictionary specifically includes: calculating the mean square error of each image block in each image block of the first type of image, arranging all the image blocks in a row in ascending order of the mean square error calculation results, thereby constructing the first original dictionary;

[0036] Constructing the second original dictionary specifically includes: directly selecting the second type of image as the second original dictionary;

[0037] Constructing the third original dictionary specifically includes: calculating the covariance of each image block in each image of the third category of images, arranging all the image blocks in a row in ascending order of the covariance calculation results, taking out one image block from every four image blocks, and arranging the taken image blocks in the form of a three-dimensional space, thereby constructing the third original dictionary.

[0038] According to the method of the first aspect of the present invention, in step S4:

[0039] The first original dictionary is learned by using an autoencoder based on deep learning, so as to obtain a first over-complete dictionary; specifically, the method includes: for the first original dictionary, the image block is input into a sparse autoencoder, and contour features and edge features are extracted respectively by using two hidden layers; and the L1 norm is added to both hidden layers to measure the sparse activation degree of the hidden layer, and the sparsity of the neuron is controlled by continuously adjusting the weight of the sparsity penalty term; the Leaky RELU function is selected as the activation function; all features are combined to form a first over-complete dictionary, and the mean square error of the image block on each unit atom in the first over-complete dictionary is calculated;

[0040] The second original dictionary is learned by using the K-SVD algorithm to obtain a second over-complete dictionary. Specifically, the method includes: performing K-SVD decomposition on each image block in the second original dictionary, and extracting the decomposition coefficients of each image block to form a sparse coefficient matrix, decomposing the product of the second original dictionary and the sparse coefficient matrix into a plurality of matrices with a rank of 1, updating the second original dictionary by using the matrix sum to obtain a second over-complete dictionary, and calculating the standard deviation of the image block on each unit atom in the second over-complete dictionary;

[0041] The third original dictionary is learned by using a 3D self-organizing map algorithm to obtain a third over-complete dictionary. Specifically, the method includes: for each image block of each image in the third category of images, the variance of the image block is calculated, an image block closest to the variance is searched in the third original dictionary as the optimal atom, the weights of the optimal atom and the neighboring atoms of the optimal atom are updated by using a Gaussian kernel function to obtain a third over-complete dictionary, and the covariance of the image block on each unit atom in the third over-complete dictionary is calculated.

[0042] According to the method of the first aspect of the present invention, in step S5:

[0043] Process the images in the test set according to steps S1 to S2 to obtain classification results of the images in the test set, and select a corresponding over-complete dictionary from the over-complete dictionary according to the classification results;

[0044] Calculate the mean square error / standard deviation / covariance for each image block in the test set, and select the closest image block from the corresponding over-complete dictionary based on the calculation results to obtain the reconstructed image;

[0045] The structural similarity between the reconstructed image and the image in the test set is calculated. When the structural similarity is higher than the similarity discrimination threshold, the dictionary learning process is stopped to obtain an over-complete dictionary after learning optimization, and the similarity discrimination threshold is 0.85.

[0046] According to the method of the first aspect of the present invention, in step S6, the address code of the image to be stored is obtained by using the overcomplete dictionary after learning and optimization, and the image to be stored is stored based on the address code; specifically, the method includes:

[0047] Processing the image to be stored according to steps S1 to S2 to obtain a classification result of the image to be stored, and selecting a corresponding over-complete dictionary from the over-complete dictionary according to the classification result;

[0048] Calculate the mean square error / standard deviation / covariance for each image block of the image to be stored, and determine the closest image block from the corresponding over-complete dictionary based on the calculation results;

[0049] The address code of the closest image block in the corresponding super-complete dictionary is extracted, and the storage of the image to be stored is completed by storing the address code.

[0050] According to the method of the first aspect of the present invention, in step S6, the stored image is reconstructed based on the address code; specifically, it includes: obtaining the address code of the stored image, locating the address code in the corresponding over-complete dictionary, and extracting the image block at the address code, and reconstructing the image based on the extracted image block.

[0051] A second aspect of the present invention provides a database image data storage system based on hierarchical sparse coding. The system comprises a processing unit, and the processing unit is configured to perform the following steps:

[0052] Step S1, performing data preprocessing on the L images in the training set after cleaning and deduplication, wherein the data preprocessing is to perform block processing on the L images in the training set;

[0053] The block cutting process evenly divides each of the L images into k image blocks, obtaining a total of L×k image blocks, and there is no overlap between the image blocks;

[0054] Step S2, performing a reference-free image quality assessment on the L×k image blocks obtained after the block processing, thereby classifying the L images;

[0055] The L images are divided into a first type of image, a second type of image, and a third type of image; the resolution of the first type of image is higher than a first threshold, the resolution of the second type of image is not higher than the first threshold and higher than a second threshold, the resolution of the third type of image is not higher than the second threshold, and the first threshold is greater than the second threshold;

[0056] Step S3, constructing a first original dictionary, a second original dictionary, and a third original dictionary based on the first category of images, the second category of images, and the third category of images respectively;

[0057] Step S4, respectively using an autoencoder based on deep learning, a K-SVD algorithm, and a 3D self-organizing map algorithm to learn the first original dictionary, the second original dictionary, and the third original dictionary to obtain a first super-complete dictionary, a second super-complete dictionary, and a third super-complete dictionary;

[0058] Step S5, combining the first overcomplete dictionary, the second overcomplete dictionary, and the third overcomplete dictionary into an overcomplete dictionary, reconstructing the images in the test set based on the overcomplete dictionary, and calculating the structural similarity between the reconstructed images and the images in the test set;

[0059] When the structural similarity is higher than the similarity discrimination threshold, the dictionary learning process is stopped, and an over-complete dictionary after learning optimization is obtained;

[0060] Step S6: using the overcomplete dictionary after learning and optimization to obtain the address code of the image to be stored, storing the image to be stored based on the address code, and reconstructing the stored image based on the address code.

[0061] The third aspect of the present invention proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the database image data storage method based on hierarchical sparse coding described in the first aspect of the present invention.

[0062] The fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for storing database image data based on hierarchical sparse coding described in the first aspect of the present invention is implemented.

[0063] In summary, in the technical solution of the present invention, firstly, a No Reference-Image Quality Assessment (NR-IQA) is performed on the input image to judge the image quality. Then, according to the judged image quality result, a sparse autoencoder (Sparse Autoencoder), a K-SVD algorithm, and a 3D Self-Organizing Map (3D SOM) algorithm based on deep learning are used to extract features for high-resolution image data, image data with clear contours, and low-resolution image data, respectively, to construct an over-complete dictionary and store them in a database. Finally, the performance of the over-complete dictionary is tested according to the structural similarity calculation result of the reconstructed image of the test set, so that the image can restore the original image data in the over-complete dictionary according to the address code, which is convenient for database storage and can also reduce the memory occupancy to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0065] Figure 1 The figure is a flowchart of a method for storing database image data based on layered sparse coding according to an embodiment of the present invention.

[0066] Figure 2 The figure is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0067] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0068] The present invention discloses a database image data storage solution based on hierarchical sparse coding, which uses hierarchical sparse coding technology to construct an ultra-complete dictionary for massive image data. First, a No Reference-Image Quality Assessment (NR-IQA) is performed on the input image to determine the image quality, and the image is divided into three categories according to the image quality determination result. Then, based on deep learning sparse autoencoder (Sparse Autoencoder), K-SVD algorithm, 3D Self-Organizing Map (3D SOM), ultra-complete dictionaries are constructed for high-resolution image data, clear contour image data, and low-resolution image data.

[0069] Among them, a sparse autoencoder based on deep learning is used to construct an over-complete dictionary for high-resolution image data. Due to the high quality of the data, the hidden layer of the autoencoder is selected to be two layers. The first layer learns the edge features of the image, and the second layer learns the contour features of the image. The activation function is Leaky RELU function, adding L1 norm to both hidden layers to measure the sparse activation degree of the hidden layer, and controlling the sparsity of neurons by continuously adjusting the weight of the sparsity penalty term. Finally, combining all the extracted features, an over-complete dictionary that can efficiently represent the original image is constructed 1. The K-SVD algorithm constructs an over-complete dictionary 2 for image data with clear contours. Since the contours of high-frequency information of this type of data are relatively clear, the data is subjected to singular value decomposition to retain important contour information. While saving storage resources, the original image can be restored to the greatest extent from the over-complete dictionary. The 3D self-organizing map algorithm is used to construct an over-complete dictionary 3 for low-resolution image data. After segmenting the initial image, the 3D self-organizing map algorithm can learn functions from all directions of the selected atoms and enhance the clarity of the contour information by changing the mean of the image block. Finally, the performance of the over-complete dictionary is judged based on the structural similarity (SSIM) calculation results of the reconstructed image of the test set, and then an over-complete dictionary that can efficiently represent the original image is constructed.

[0070] This technology alleviates the problem of slow processing speed caused by storing a large amount of binary data in the database to a certain extent. At the same time, different algorithms are used to construct corresponding super-complete dictionaries for data of different qualities, so that all data can be restored to the greatest extent; it avoids the problem that the database cannot read the data when the storage path location changes when the image data is stored in the local disk. This technology can efficiently decode the original image in the super-complete dictionary through the address code of the original image, select a fixed location in the database to store the super dictionary, and save the address code of each image, so as to save storage space while ensuring the processing efficiency of the database to a certain extent.

[0071] The goal and task of the database image data storage technology based on hierarchical sparse coding is: based on the characteristics of redundant information in all signals, use sparse coding technology to construct an over-complete dictionary for the image data in the database; perform No Reference-Image Quality Assessment (NR-IQA) on the input image to determine the quality of the image, and use the sparse autoencoder based on deep learning, K-SVD algorithm, and 3D self-organizing map algorithm to construct the corresponding over-complete dictionary for high-resolution images, clear contour images, and low-resolution images, respectively, and parse the image data into address codes and atomic units in the over-complete dictionary and store them in the database. On the one hand, the image data can be migrated or changed at any time according to the database to avoid the situation where the database cannot obtain the image data after the image data is stored in the local disk and the path is changed; on the other hand, high-definition images can also be stored in the database without binary conversion. At the same time, the over-complete dictionary removes the redundant information of the original image data and only saves the contour feature atoms, which alleviates the problem of memory usage to a certain extent.

[0072] The first aspect of the present invention provides a database image data storage method based on hierarchical sparse coding. Figure 1 As shown, the method includes:

[0073] Step S1, performing data preprocessing on the L images in the training set after cleaning and deduplication, wherein the data preprocessing is to perform block processing on the L images in the training set;

[0074] The block cutting process evenly divides each of the L images into k image blocks, obtaining a total of L×k image blocks, and there is no overlap between the image blocks;

[0075] Step S2, performing a reference-free image quality assessment on the L×k image blocks obtained after the block processing, thereby classifying the L images;

[0076] The L images are divided into a first type of image, a second type of image, and a third type of image; the resolution of the first type of image is higher than a first threshold, the resolution of the second type of image is not higher than the first threshold and higher than a second threshold, the resolution of the third type of image is not higher than the second threshold, and the first threshold is greater than the second threshold;

[0077] Step S3, constructing a first original dictionary, a second original dictionary, and a third original dictionary based on the first category of images, the second category of images, and the third category of images respectively;

[0078] Step S4, respectively using an autoencoder based on deep learning, a K-SVD algorithm, and a 3D self-organizing map algorithm to learn the first original dictionary, the second original dictionary, and the third original dictionary to obtain a first super-complete dictionary, a second super-complete dictionary, and a third super-complete dictionary;

[0079] Step S5, combining the first overcomplete dictionary, the second overcomplete dictionary, and the third overcomplete dictionary into an overcomplete dictionary, reconstructing the images in the test set based on the overcomplete dictionary, and calculating the structural similarity between the reconstructed images and the images in the test set;

[0080] When the structural similarity is higher than the similarity discrimination threshold, the dictionary learning process is stopped, and an over-complete dictionary after learning optimization is obtained;

[0081] Step S6: using the overcomplete dictionary after learning and optimization to obtain the address code of the image to be stored, storing the image to be stored based on the address code, and reconstructing the stored image based on the address code.

[0082] In some embodiments, there are two common forms of image segmentation: one is to divide a picture into blocks of size The image is divided into Repeating blocks ( m Much smaller than N , there are overlaps between small blocks), this segmentation method can effectively alleviate the problem of reconstructing boundary shadow lines during image reconstruction. m =4 as an example, the size is The pixel image can be segmented into The second method is to directly convert the pixels into small images, but the computational workload is also huge. The image is divided into blocks of the same size (there is no overlap between blocks). Compared with the first method, this method cuts out fewer small blocks of images. In the later dictionary learning stage, the learning speed is fast, but in order to ensure the effectiveness of the later sparse decoding work, a high-performance dictionary learning algorithm needs to be selected.

[0083] According to the method of the first aspect of the present invention, in step S2, performing no-reference image quality assessment on the image block specifically includes:

[0084] For each of the L images, each of the k image blocks obtained after the image is segmented is processed as follows: the grayscale average value of all pixels is calculated, the grayscale value of each pixel is subtracted by the grayscale average value and then the square sum is calculated, and all pixels are standardized; the greater the change in pixel grayscale, the higher the resolution; otherwise, the lower the resolution;

[0085] The number of image blocks with a resolution greater than a first threshold, the number of image blocks with a resolution not higher than the first threshold and higher than a second threshold, and the number of image blocks with a resolution not higher than the second threshold are counted among the k image blocks of the image, and a classification result of the image is obtained according to the number of image blocks obtained by counting.

[0086] In some embodiments, image quality assessment is to judge the clarity of the image, which can usually be high-resolution images and low-resolution images respectively, while non-reference image quality assessment is to judge the clarity of the image only with the distorted image (or the image itself) and without the reference image for comparison, which is very difficult and is also a research hotspot in the current image field. The present invention requires NR-IQA on a large amount of pre-processed data. Here we choose the image blur estimation method to judge the image quality.

[0087] The present invention selects an image blur estimation method to judge the image quality. For the preprocessed image data, the grayscale average value of all pixels is first calculated, the grayscale value of each pixel is subtracted and the square sum is calculated, and then all pixels are standardized and the calculation results are analyzed. The greater the pixel grayscale change, the higher the image resolution, otherwise, the lower the image resolution; finally, according to the grayscale calculation results, the image is divided into high-resolution, clear-contour, and low-resolution images.

[0088] According to the method of the first aspect of the present invention, in step S3:

[0089] Constructing the first original dictionary specifically includes: calculating the mean square error of each image block in each image block of the first type of image, arranging all the image blocks in a row in ascending order of the mean square error calculation results, thereby constructing the first original dictionary;

[0090] Constructing the second original dictionary specifically includes: directly selecting the second type of image as the second original dictionary;

[0091] Constructing the third original dictionary specifically includes: calculating the covariance of each image block in each image of the third category of images, arranging all the image blocks in a row in ascending order of the covariance calculation results, taking out one image block from every four image blocks, and arranging the taken image blocks in the form of a three-dimensional space, thereby constructing the third original dictionary.

[0092] In some embodiments, the present invention involves the initialization dictionary construction of three over-complete dictionaries, wherein the construction of over-complete dictionaries 1 and 3 requires first segmenting the original image, and over-complete dictionary 3 needs to select some image blocks as its original dictionary, and the selected image blocks are arranged in a three-dimensional space; and the original dictionary construction of over-complete dictionary 2 can directly define the original image as the original over-complete dictionary 2, and then use the singular value decomposition algorithm to update the dictionary and sparse coefficients column by column, thereby completing the construction of over-complete dictionary 2.

[0093] First, the original dictionary of the over-complete dictionary 1 is constructed. The present invention selects a high-resolution image to construct the original dictionary of the over-complete dictionary 1. First, the original image is segmented into small blocks of 8×8 in size. Then, the mean square error of each small image block is calculated. All image blocks are arranged in a row from small to large according to the mean square error calculation result to construct the original dictionary of the over-complete dictionary 1.

[0094] Constructing the original dictionary of the super-complete dictionary 2, the present invention selects an image with clear contours to construct the original dictionary of the super-complete dictionary 2. Here we directly select the original image as the original dictionary of the super-complete dictionary 2.

[0095] Constructing the original dictionary of the over-complete dictionary 3, the present invention selects to construct the original dictionary of the over-complete dictionary 3 for the low-resolution image, and also firstly segments the image into small blocks of 4×4 in size, and then calculates the covariance of each small image block, and arranges all the image blocks in a row from small to large according to the covariance calculation result, and selects a column of original dictionaries according to the principle of taking one out of every four image blocks, and arranges this column of atoms in the form of a three-dimensional space to form the original dictionary of the over-complete dictionary 3.

[0096] According to the method of the first aspect of the present invention, in step S4:

[0097] The first original dictionary is learned by using an autoencoder based on deep learning, so as to obtain a first over-complete dictionary; specifically, the method includes: for the first original dictionary, the image block is input into a sparse autoencoder, and contour features and edge features are extracted respectively by using two hidden layers; and the L1 norm is added to both hidden layers to measure the sparse activation degree of the hidden layer, and the sparsity of the neuron is controlled by continuously adjusting the weight of the sparsity penalty term; the Leaky RELU function is selected as the activation function; all features are combined to form a first over-complete dictionary, and the mean square error of the image block on each unit atom in the first over-complete dictionary is calculated;

[0098] The second original dictionary is learned by using the K-SVD algorithm to obtain a second over-complete dictionary. Specifically, the method includes: performing K-SVD decomposition on each image block in the second original dictionary, and extracting the decomposition coefficients of each image block to form a sparse coefficient matrix, decomposing the product of the second original dictionary and the sparse coefficient matrix into a plurality of matrices with a rank of 1, updating the second original dictionary by using the matrix sum to obtain a second over-complete dictionary, and calculating the standard deviation of the image block on each unit atom in the second over-complete dictionary;

[0099] The third original dictionary is learned by using a 3D self-organizing map algorithm to obtain a third over-complete dictionary. Specifically, the method includes: for each image block of each image in the third category of images, the variance of the image block is calculated, an image block closest to the variance is searched in the third original dictionary as the optimal atom, the weights of the optimal atom and the neighboring atoms of the optimal atom are updated by using a Gaussian kernel function to obtain a third over-complete dictionary, and the covariance of the image block on each unit atom in the third over-complete dictionary is calculated.

[0100] In some embodiments, for the original dictionary 1, the sliced ​​image is placed in a sparse autoencoder, and two hidden layers are designed to extract contour features and edge features of the image respectively. In order to ensure the sparsity of the final extracted features, the L1 norm is added to both hidden layers to measure the sparse activation degree of the hidden layer. The sparsity of the neurons is controlled by continuously adjusting the weights of the sparsity penalty terms. The activation function of the present invention selects the Leaky RELU function, and finally all contour features and edge features are extracted. All features are combined to form an over-complete dictionary 1, and the mean square error of each unit atom therein is calculated.

[0101] In some embodiments, for the original dictionary 2, first, for the fixed original dictionary 2, the sparse coefficient matrix of the original dictionary is updated column by column. After all updates are completed, the product of the original dictionary and the sparse coefficient matrix is ​​decomposed into the sum of multiple matrices with rank 1, and the original dictionary is updated. Each column of the original dictionary is updated in turn. The column to be updated is extracted, and the corresponding column is also extracted in the original signal. Then, the original signal is singular value decomposition, and the first column of the decomposed matrix is ​​used as the first column of the dictionary. The dictionary is updated in turn, and the dictionary is divided into small blocks of size 4×4 as unit atoms. The standard deviation of each unit atom is calculated, and finally an over-complete dictionary 2 is formed.

[0102] In some embodiments, for the original dictionary 3, the variance of each small block of the original image is calculated, and the atom with the closest variance to the calculation result is searched in the original dictionary as the optimal atom. Then, a suitable three-dimensional spatial neighborhood function and learning function are selected to update the atomic weights. Here, we select the Gaussian kernel function as the learning function of the original dictionary 3, and select the atoms involved in the Chebyshev distance as the neighborhood atoms to be updated of the optimal atom. Then, the Gaussian kernel function is used to update the weights of the optimal atom and its neighborhood atoms. After all the original small image blocks are traversed, an over-complete dictionary 3 is formed, and the covariance of each unit atom therein is calculated.

[0103] According to the method of the first aspect of the present invention, in step S5:

[0104] Process the images in the test set according to steps S1 to S2 to obtain classification results of the images in the test set, and select a corresponding over-complete dictionary from the over-complete dictionary according to the classification results;

[0105] Calculate the mean square error / standard deviation / covariance for each image block in the test set, and select the closest image block from the corresponding over-complete dictionary based on the calculation results to obtain the reconstructed image;

[0106] The structural similarity between the reconstructed image and the image in the test set is calculated. When the structural similarity is higher than the similarity discrimination threshold, the dictionary learning process is stopped to obtain an over-complete dictionary after learning optimization, and the similarity discrimination threshold is 0.85.

[0107] In some embodiments, after the construction of the three super-complete dictionaries is completed, the performance of the super-complete dictionary is tested using a test set, the test set image is subjected to NR-IQA judgment, assigned to the corresponding image quality category, and the image is reconstructed in the corresponding super-complete dictionary. The structural similarity (SSIM) of the original image and the reconstructed image is calculated. When the final result value is between 0.85-1, the super-dictionary learning is stopped, otherwise the atomic weights continue to be updated. Specifically including:

[0108] (1) Performing no-reference image quality assessment (NR-IQA) on the test set, the test set is divided into high-resolution images, clear-contour images, and low-resolution images according to the assessment results;

[0109] (2) Constructing the initial dictionary: For high-resolution images, first divide the image into small blocks of 8×8 size, calculate the mean square error of each small image block, and arrange all the image blocks in a row from small to large according to the mean square error calculation result to construct the original dictionary of over-complete dictionary 1; for images with clear contours, construct the original dictionary of over-complete dictionary 2, and select the original image as the original dictionary of over-complete dictionary 2; for low-resolution images, construct the original dictionary of over-complete dictionary 3, divide all images into small blocks of 4×4 size, calculate the covariance of each small image block, and arrange all the image blocks in a row from small to large according to the covariance calculation result, taking one out of every four image blocks, and arrange all atoms in a three-dimensional spatial form to construct the original dictionary of over-complete dictionary 3.

[0110] (3) Dictionary learning. For the original dictionary 1, the sliced ​​image is placed in a sparse autoencoder. The two hidden layers extract the contour features and edge features of the image respectively. In order to ensure the sparsity of the final extracted features, the L1 norm is added to both hidden layers to measure the sparse activation degree of the hidden layer. The sparsity of the neurons is controlled by continuously adjusting the weight of the sparsity penalty term. The activation function of the supercomplete dictionary 1 of the present invention is Leaky. RELU function is used to finally extract all contour features and edge features to form an over-complete dictionary 1, and the mean square error of each atom in the dictionary is calculated. For the original dictionary 2, the sparse coefficient matrix of the original dictionary is first updated column by column, and then the original dictionary is updated. Each column of the original dictionary is updated in turn, and the columns to be updated are extracted from the original signal. After that, singular value decomposition is performed, and the first column of the decomposed matrix is ​​used as the first column of the dictionary. The dictionary is updated in turn to finally form an over-complete dictionary 2. The features extracted by the over-complete dictionary 2 are segmented into small blocks of size 4×4 as unit atoms, and the standard deviation of each atom is calculated. For the original dictionary 3, the variance of each small block of the original image is calculated, and the atom with the closest variance is found in the original dictionary as the optimal atom. The atoms involved in the Chebyshev distance are selected as the neighboring atoms to be updated. The Gaussian kernel function is selected as the learning function to update the weights of the optimal atom and its neighboring atoms. After all the original small image blocks are traversed, an over-complete dictionary 3 is formed, and the covariance of each atom is calculated.

[0111] (4) Structural similarity calculation (SSIM). After the construction of the three over-complete dictionaries is completed, the performance of the over-complete dictionaries is tested using the test set. When the final result value of the structural similarity (SSIM) is between 0.85 and 1, the learning of the over-complete dictionary is stopped. Otherwise, the atomic weights continue to be updated. Finally, the three over-complete dictionaries 1 and 2 are arranged in the form of M×N, and the over-complete dictionary 3 is arranged in the form of M×N×L.

[0112] According to the method of the first aspect of the present invention, in step S6, the address code of the image to be stored is obtained by using the overcomplete dictionary after learning and optimization, and the image to be stored is stored based on the address code; specifically, the method includes:

[0113] Processing the image to be stored according to steps S1 to S2 to obtain a classification result of the image to be stored, and selecting a corresponding over-complete dictionary from the over-complete dictionary according to the classification result;

[0114] Calculate the mean square error / standard deviation / covariance for each image block of the image to be stored, and determine the closest image block from the corresponding over-complete dictionary based on the calculation results;

[0115] The address code of the closest image block in the corresponding super-complete dictionary is extracted, and the storage of the image to be stored is completed by storing the address code.

[0116] In some embodiments, the image to be stored is first subjected to (NR-IQA) judgment, and the image is divided into corresponding categories according to the judgment result, and the image is segmented. According to the size of the corresponding super-complete dictionary atom, the mean square error, standard deviation or covariance of each small image block is calculated, and then the closest atom is found in the corresponding super-complete dictionary as the winning atom, and the spatial coordinates of the atom are recorded. The spatial coordinates of each image block in the corresponding super-complete dictionary are the address code of the image block, and the image to be stored can be stored according to the address code set of each small image block.

[0117] According to the method of the first aspect of the present invention, in step S6, the stored image is reconstructed based on the address code; specifically, it includes: obtaining the address code of the stored image, locating the address code in the corresponding over-complete dictionary, and extracting the image block at the address code, and reconstructing the image based on the extracted image block.

[0118] A second aspect of the present invention provides a database image data storage system based on hierarchical sparse coding. The system comprises a processing unit, and the processing unit is configured to perform the following steps:

[0119] Step S1, performing data preprocessing on the L images in the training set after cleaning and deduplication, wherein the data preprocessing is to perform block processing on the L images in the training set;

[0120] The block cutting process evenly divides each of the L images into k image blocks, obtaining a total of L×k image blocks, and there is no overlap between the image blocks;

[0121] Step S2, performing a reference-free image quality assessment on the L×k image blocks obtained after the block processing, thereby classifying the L images;

[0122] The L images are divided into a first type of image, a second type of image, and a third type of image; the resolution of the first type of image is higher than a first threshold, the resolution of the second type of image is not higher than the first threshold and higher than a second threshold, the resolution of the third type of image is not higher than the second threshold, and the first threshold is greater than the second threshold;

[0123] Step S3, constructing a first original dictionary, a second original dictionary, and a third original dictionary based on the first category of images, the second category of images, and the third category of images respectively;

[0124] Step S4, respectively using an autoencoder based on deep learning, a K-SVD algorithm, and a 3D self-organizing map algorithm to learn the first original dictionary, the second original dictionary, and the third original dictionary to obtain a first super-complete dictionary, a second super-complete dictionary, and a third super-complete dictionary;

[0125] Step S5, combining the first overcomplete dictionary, the second overcomplete dictionary, and the third overcomplete dictionary into an overcomplete dictionary, reconstructing the images in the test set based on the overcomplete dictionary, and calculating the structural similarity between the reconstructed images and the images in the test set;

[0126] When the structural similarity is higher than the similarity discrimination threshold, the dictionary learning process is stopped, and an over-complete dictionary after learning optimization is obtained;

[0127] Step S6: using the overcomplete dictionary after learning and optimization to obtain the address code of the image to be stored, storing the image to be stored based on the address code, and reconstructing the stored image based on the address code.

[0128] The third aspect of the present invention proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the steps in the database image data storage method based on hierarchical sparse coding described in the first aspect of the present invention.

[0129] Figure 2 is a structural diagram of an electronic device according to an embodiment of the present invention, such as Figure 2As shown, the electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, near field communication (NFC) or other technologies. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.

[0130] Those skilled in the art will understand that Figure 2 The structure shown in the figure is only a structural diagram of the part related to the technical solution of the present disclosure, and does not constitute a limitation on the electronic device to which the technical solution of the present application is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0131] The fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the database image data storage method based on hierarchical sparse coding described in the first aspect of the present invention.

[0132] In summary, in the technical solution of the present invention, firstly, a No Reference-Image Quality Assessment (NR-IQA) is performed on the input image to judge the image quality. Then, according to the judged image quality result, a sparse autoencoder (Sparse Autoencoder), a K-SVD algorithm, and a 3D (3DSelf-Organizing Map, 3D SOM) self-organizing map algorithm based on deep learning are used to extract features for high-resolution image data, clear contour image data, and low-resolution image data, respectively, to construct an over-complete dictionary and store them in a database. Finally, the performance of the over-complete dictionary is tested according to the structural similarity calculation results of the reconstructed image of the test set, so that the image can restore the original image data in the over-complete dictionary according to the address code, which is convenient for database storage and can also reduce the memory occupancy to a certain extent.

[0133] Please note that the technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above-mentioned embodiments only express several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several variations and improvements can be made, which all belong to the scope of protection of the present application. Therefore, the scope of protection of the patent in this application shall be based on the attached claims.

Claims

1. A database image data storage method based on hierarchical sparse coding, characterized in that: The method comprises: Step S1, performing data preprocessing on the L images in the training set after cleaning and deduplication, wherein the data preprocessing is to perform block processing on the L images in the training set; The block cutting process evenly divides each of the L images into k image blocks, obtaining a total of L×k image blocks, and there is no overlap between the image blocks; Step S2, performing a reference-free image quality assessment on the L×k image blocks obtained after the block processing, thereby classifying the L images; The L images are divided into a first type of image, a second type of image, and a third type of image; the resolution of the first type of image is higher than a first threshold, the resolution of the second type of image is not higher than the first threshold and higher than a second threshold, the resolution of the third type of image is not higher than the second threshold, and the first threshold is greater than the second threshold; Step S3, constructing a first original dictionary, a second original dictionary, and a third original dictionary based on the first category of images, the second category of images, and the third category of images respectively; Step S4, respectively using an autoencoder based on deep learning, a K-SVD algorithm, and a 3D self-organizing map algorithm to learn the first original dictionary, the second original dictionary, and the third original dictionary to obtain a first super-complete dictionary, a second super-complete dictionary, and a third super-complete dictionary; Step S5, combining the first overcomplete dictionary, the second overcomplete dictionary, and the third overcomplete dictionary into an overcomplete dictionary, reconstructing the images in the test set based on the overcomplete dictionary, and calculating the structural similarity between the reconstructed images and the images in the test set; When the structural similarity is higher than the similarity discrimination threshold, the dictionary learning process is stopped to obtain an over-complete dictionary after learning optimization; Step S6, using the overcomplete dictionary after learning and optimization to obtain the address code of the image to be stored, storing the image to be stored based on the address code, and reconstructing the stored image based on the address code; Wherein, in step S4: The first original dictionary is learned by using an autoencoder based on deep learning, so as to obtain a first over-complete dictionary; specifically, the method includes: for the first original dictionary, the image block is input into a sparse autoencoder, and contour features and edge features are extracted respectively by using two hidden layers; and the L1 norm is added to both hidden layers to measure the sparse activation degree of the hidden layer, and the sparsity of the neuron is controlled by continuously adjusting the weight of the sparsity penalty term; the Leaky RELU function is selected as the activation function; all features are combined to form a first over-complete dictionary, and the mean square error of the image block on each unit atom in the first over-complete dictionary is calculated; The second original dictionary is learned by using the K-SVD algorithm to obtain a second over-complete dictionary. Specifically, the method includes: performing K-SVD decomposition on each image block in the second original dictionary, and extracting the decomposition coefficients of each image block to form a sparse coefficient matrix, decomposing the product of the second original dictionary and the sparse coefficient matrix into a plurality of matrices with a rank of 1, updating the second original dictionary by using the matrix sum to obtain a second over-complete dictionary, and calculating the standard deviation of the image block on each unit atom in the second over-complete dictionary; The third original dictionary is learned by using a 3D self-organizing map algorithm to obtain a third over-complete dictionary. Specifically, the method includes: for each image block of each image in the third type of image, the variance of the image block is calculated, and the image block closest to the variance is searched in the third original dictionary as the optimal atom. The weights of the optimal atom and the neighboring atoms of the optimal atom are updated by using a Gaussian kernel function to obtain a third over-complete dictionary, and the covariance of the image block on each unit atom in the third over-complete dictionary is calculated. Wherein, in step S5: Process the images in the test set according to steps S1 to S2 to obtain classification results of the images in the test set, and select a corresponding over-complete dictionary from the over-complete dictionary according to the classification results; Calculate the mean square error / standard deviation / covariance for each image block in the test set, and select the closest image block from the corresponding over-complete dictionary based on the calculation results to obtain the reconstructed image; The structural similarity between the reconstructed image and the image in the test set is calculated. When the structural similarity is higher than the similarity discrimination threshold, the dictionary learning process is stopped to obtain an over-complete dictionary after learning optimization, and the similarity discrimination threshold is 0.

85.

2. The method for storing database image data based on hierarchical sparse coding according to claim 1, characterized in that: In step S2, performing no-reference image quality assessment on the image block specifically includes: For each of the L images, each of the k image blocks obtained after the image is segmented is processed as follows: the grayscale average value of all pixels is calculated, the grayscale value of each pixel is subtracted by the grayscale average value and then the square sum is calculated, and all pixels are standardized; the greater the change in pixel grayscale, the higher the resolution; otherwise, the lower the resolution; The number of image blocks with a resolution greater than a first threshold, the number of image blocks with a resolution not higher than the first threshold and higher than a second threshold, and the number of image blocks with a resolution not higher than the second threshold are counted among the k image blocks of the image, and a classification result of the image is obtained according to the number of image blocks obtained by counting.

3. The method for storing database image data based on hierarchical sparse coding according to claim 1, characterized in that: In step S3: Constructing the first original dictionary specifically includes: calculating the mean square error of each image block in each image block of the first type of image, arranging all the image blocks in a row in ascending order of the mean square error calculation results, thereby constructing the first original dictionary; Constructing the second original dictionary specifically includes: directly selecting the second type of image as the second original dictionary; Constructing the third original dictionary specifically includes: calculating the covariance of each image block in each image of the third category of images, arranging all the image blocks in a row in ascending order of the covariance calculation results, taking out one image block from every four image blocks, and arranging the taken image blocks in the form of a three-dimensional space, thereby constructing the third original dictionary.

4. The method for storing database image data based on hierarchical sparse coding according to claim 1, characterized in that: In step S6, the address code of the image to be stored is obtained by using the overcomplete dictionary after learning and optimization, and the image to be stored is stored based on the address code; specifically, the following steps are included: Processing the image to be stored according to steps S1 to S2 to obtain a classification result of the image to be stored, and selecting a corresponding over-complete dictionary from the over-complete dictionary according to the classification result; Calculate the mean square error / standard deviation / covariance for each image block of the image to be stored, and determine the closest image block from the corresponding over-complete dictionary based on the calculation results; The address code of the closest image block in the corresponding super-complete dictionary is extracted, and the storage of the image to be stored is completed by storing the address code.

5. The method for storing database image data based on hierarchical sparse coding according to claim 1, characterized in that: In step S6, the stored image is reconstructed based on the address code; specifically, the process includes: obtaining the address code of the stored image, locating the address code in the corresponding over-complete dictionary, extracting the image block at the address code, and reconstructing the image based on the extracted image block.

6. A database image data storage system based on hierarchical sparse coding, characterized in that: The system comprises a processing unit configured to perform the following steps: Step S1, performing data preprocessing on the L images in the training set after cleaning and deduplication, wherein the data preprocessing is to perform block processing on the L images in the training set; The block cutting process evenly divides each of the L images into k image blocks, obtaining a total of L×k image blocks, and there is no overlap between the image blocks; Step S2, performing a reference-free image quality assessment on the L×k image blocks obtained after the block processing, thereby classifying the L images; The L images are divided into a first type of image, a second type of image, and a third type of image; the resolution of the first type of image is higher than a first threshold, the resolution of the second type of image is not higher than the first threshold and higher than a second threshold, the resolution of the third type of image is not higher than the second threshold, and the first threshold is greater than the second threshold; Step S3, constructing a first original dictionary, a second original dictionary, and a third original dictionary based on the first category of images, the second category of images, and the third category of images respectively; Step S4, respectively using an autoencoder based on deep learning, a K-SVD algorithm, and a 3D self-organizing map algorithm to learn the first original dictionary, the second original dictionary, and the third original dictionary to obtain a first super-complete dictionary, a second super-complete dictionary, and a third super-complete dictionary; Step S5, combining the first overcomplete dictionary, the second overcomplete dictionary, and the third overcomplete dictionary into an overcomplete dictionary, reconstructing the images in the test set based on the overcomplete dictionary, and calculating the structural similarity between the reconstructed images and the images in the test set; When the structural similarity is higher than the similarity discrimination threshold, the dictionary learning process is stopped to obtain an over-complete dictionary after learning optimization; Step S6, using the overcomplete dictionary after learning and optimization to obtain the address code of the image to be stored, storing the image to be stored based on the address code, and reconstructing the stored image based on the address code; Wherein, in step S4: The first original dictionary is learned by using an autoencoder based on deep learning, so as to obtain a first over-complete dictionary; specifically, the method includes: for the first original dictionary, the image block is input into a sparse autoencoder, and contour features and edge features are extracted respectively by using two hidden layers; and the L1 norm is added to both hidden layers to measure the sparse activation degree of the hidden layer, and the sparsity of the neuron is controlled by continuously adjusting the weight of the sparsity penalty term; the Leaky RELU function is selected as the activation function; all features are combined to form a first over-complete dictionary, and the mean square error of the image block on each unit atom in the first over-complete dictionary is calculated; The second original dictionary is learned by using the K-SVD algorithm to obtain a second over-complete dictionary. Specifically, the method includes: performing K-SVD decomposition on each image block in the second original dictionary, and extracting the decomposition coefficients of each image block to form a sparse coefficient matrix, decomposing the product of the second original dictionary and the sparse coefficient matrix into a plurality of matrices with a rank of 1, updating the second original dictionary by using the matrix sum to obtain a second over-complete dictionary, and calculating the standard deviation of the image block on each unit atom in the second over-complete dictionary; The third original dictionary is learned by using a 3D self-organizing map algorithm to obtain a third over-complete dictionary. Specifically, the method includes: for each image block of each image in the third type of image, the variance of the image block is calculated, and the image block closest to the variance is searched in the third original dictionary as the optimal atom. The weights of the optimal atom and the neighboring atoms of the optimal atom are updated by using a Gaussian kernel function to obtain a third over-complete dictionary, and the covariance of the image block on each unit atom in the third over-complete dictionary is calculated. Wherein, in step S5: Process the images in the test set according to steps S1 to S2 to obtain classification results of the images in the test set, and select a corresponding over-complete dictionary from the over-complete dictionary according to the classification results; Calculate the mean square error / standard deviation / covariance for each image block in the test set, and select the closest image block from the corresponding over-complete dictionary based on the calculation results to obtain the reconstructed image; The structural similarity between the reconstructed image and the image in the test set is calculated. When the structural similarity is higher than the similarity discrimination threshold, the dictionary learning process is stopped to obtain an over-complete dictionary after learning optimization, and the similarity discrimination threshold is 0.

85.

7. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps in the database image data storage method based on hierarchical sparse coding described in any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the database image data storage method based on hierarchical sparse coding described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Improved sparse representation based image super-resolution method

    CN102930518A

  • Super-resolution image restoration method based on category prior nonnegative sparse coding dictionary pair

    CN103679662A

  • Infrared image super resolution reconstruction method based on sparse representation

    CN106934766A

  • A method for recognizing heterogeneous iris and a computing device

    CN109241928A

  • Method for detecting anomalies in images using a plurality of machine learning programs

    EP4145401A1