Multi-picture comprehensive quality guarantee compression method based on entropy analysis
By combining entropy value analysis and reinforcement learning technology, dynamically adjusting the image compression ratio, the balance problem between image compression efficiency and visual information retention in the prior art is solved, and efficient and effective image compression effect is achieved.
Patent Information
- Application Number
- CN202510240111.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2045-03-03
AI Technical Summary
The prior art fails to effectively balance the compression efficiency with the retention of image effective visual information during image compression, resulting in unsatisfactory effects in important image scenarios.
By introducing entropy value analysis and reinforcement learning technology, the compression ratio of images is dynamically adjusted, and the best compression strategy for different images is independently learned and adapted to different images according to the information entropy, original size and processing load of the image.
It realizes that while reducing the image volume, it retains the effective visual data information in the image as much as possible, which significantly improves the effectiveness and practicality of compressed images, especially in application scenarios where high-precision image recognition and processing are required.
Smart Images

Figure CN119743627A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of enhanced deep learning image processing, and in particular to a comprehensive quality-preserving compression method for multiple images based on entropy value analysis. Background Art
[0002] In machine vision applications, it is usually necessary to compress the original image to a certain extent. First, machine vision systems often need to process a large amount of image data. For example, in industrial automation, production line cameras capture hundreds of images per second. Compression can significantly reduce storage space requirements and reduce hardware costs. Secondly, in real-time monitoring and security systems, compressed images can speed up data transmission, ensure rapid system response, and improve the monitoring capabilities of security cameras in the network. In addition, in self-driving cars, compression technology reduces the computational burden of subsequent processing, making image recognition and object detection algorithms more efficient and improving driving safety. At the same time, in low-bandwidth environments, such as drone surveillance missions, compression technology can effectively reduce network bandwidth usage and ensure the transmission of important information. In summary, image compression in machine vision not only improves storage and transmission efficiency, but also optimizes computing performance, and is a key step in achieving efficient and intelligent processing.
[0003] However, in machine vision applications, such as autonomous vehicle identification, security monitoring, etc., the validity of the visual data information of the image is extremely critical. The loss of information during the compression process may cause a significant decrease in the practical value of the image, such as object recognition models (e.g. YOLO When processing compressed images, algorithms may not be able to accurately identify or locate objects due to the loss of image details. Without image compression, the visual data in the image contains a large amount of redundant information, which not only does not contribute to the practical value of the image, but also greatly increases the size of the image, resulting in unnecessary storage resources and transmission time consumption. In addition, traditional compression methods often use a fixed compression strategy for all images, failing to take into account the complexity of the image content and the actual needs in specific applications. This "one-size-fits-all" approach cannot effectively balance compression efficiency and the retention of effective visual information in the image, resulting in unsatisfactory results in important image scenarios.
[0004] In order to solve these problems, an innovative image compression method is urgently needed. Summary of the invention
[0005] To solve the above problems, this application proposes an innovative image compression method. The core of this method is to introduce the information entropy of the image into the consideration of image compression, and dynamically adjust the compression ratio according to the information entropy of the image, the original size of the image, the processing load of autonomous driving, etc., so as to achieve the goal of reducing the image volume while retaining the effective visual data information in the image as much as possible. By introducing reinforcement learning technology, this method can autonomously learn and adapt to the optimal compression strategy for different images, thereby maximizing the practical value of the image. Especially in application scenarios that require high-precision image recognition and processing, it can significantly improve the effectiveness and practicality of compressed images.
[0006] The present invention provides a method for comprehensive quality-preserving compression of multiple images based on entropy value analysis, and the specific steps are as follows: S1. Perform information entropy analysis on the images generated in the machine vision application to obtain the information entropy of the images; S2, combining the information entropy, image size, and machine vision equipment with reinforcement learning technology, and obtaining the corresponding DQN Network, machine vision equipment DQN The network is used to process the generated images, obtain the target compression ratio, and obtain the target compression solution for images in machine vision applications.
[0007] Preferably, the information entropy of the image generated in the machine vision application is analyzed and calculated to obtain the expression of the information entropy of the image: ; in, is the information entropy of the image, Represents pixel pairs The probability of appearing in the image.
[0008] Preferably, wherein The calculation formula is as follows: ; Among them, the pixel pair middle represents the gray value of the center pixel in the sliding window, b is the average gray value of the pixels in the sliding window excluding the central pixel, Is a pixel pair The frequency of occurrence of all pixels in the entire image, is the number of pixels, For a specific visual data processing task, it is equivalent to a picture. In Indicates the order of the pictures themselves.
[0009] Preferably, the specific content of S2 includesDQN Status state definition, DQN Action action Definition and DQN Rewards reward definition; Among them, DQN Status state The specific contents of the definition are: Defining states state for ,in e The information entropy of the image reflects the complexity and amount of information in the image. s Represents the original size of the image, Represents the number of images that need to be processed by the machine vision device at the same time; Among them, DQN Action action The specific contents of the definition are: For an original image, DQN Made to it action for: ; Preferably, DQN Rewards reward The specific content is: For image processing tasks , define the image processing task From generating, calculating image information entropy, compressing to being used for specific applications YOLO The processing time is The accuracy of the processing result is ; Defining image processing tasks After the processing is completed, the total number of images processed by the specific application is ; Then define a specific image processing task After being processed, DQN What you get reward for: .
[0010] Preferably, DQN The network training steps are: Step 1. Initialization DQN of Q Network and Experience Replay Pool D ; Step 2 starts multiple rounds of training; The specific contents of starting multiple rounds of training in step 2 are: Step 2.1: Get the first one from the external environmentstate ,for( , , ); Step 2.2 DQN An action is chosen randomly with probability ε, or a value of argmax_a'Q ( state,a' ) action, and record the selected action as ; Step 2.3 DQN Execute an action , get rewarded , and then get the new state from the outside world next_state , and then ( state, , ,next_state ) tuples are stored in the experience replay pool D , the new state obtained from the outside world next_ state Set as Current state , check the experience replay pool at this time D ; If the experience replay pool is large enough, D Randomly select a small batch of transformations from state, , , next_state ), calculate for each transformation = + , then use Update the network Q for the loss; If this is not the last round of training, reduce the value of ε and repeat steps 2.1 to 2.3.
[0011] In summary, the comprehensive quality-preserving compression method for multiple images based on entropy analysis of the present invention is more effective in balancing time consumption and accuracy under various work intensities than conventional technologies. Under low work intensity, the processing time is kept low and the accuracy is acceptable, while under high work intensity, the processing time is adapted to the increased work intensity, ensuring efficient processing time while improving accuracy.
[0012] The technical method of the present invention is further described in detail below through the drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1The relationship between information entropy, compression ratio and accuracy of a multi-image comprehensive quality-preserving compression method based on entropy value analysis of the present invention; Figure 2 In the present invention, a method for comprehensive quality preservation of multiple pictures based on entropy value analysis is provided. and reward The relationship between accuracy and time; Figure 3 is the cumulative distribution function of the time under low working intensity of a multi-image comprehensive quality compression method based on entropy value analysis of the present invention ( CDF )picture; Figure 4 is the cumulative distribution function of the accuracy of the multi-image comprehensive quality compression method based on entropy value analysis under low working intensity of the present invention ( CDF )picture; Figure 5 is the cumulative distribution function of the time under high working intensity of a multi-image comprehensive quality compression method based on entropy value analysis of the present invention ( CDF )picture; Figure 6 is the cumulative distribution function of the accuracy rate under high working intensity of the multi-image comprehensive quality compression method based on entropy value analysis of the present invention ( CDF )picture. DETAILED DESCRIPTION
[0014] The technical method of the present invention is further described below by means of the accompanying drawings and embodiments. It should be noted that unless otherwise specifically stated, the relative arrangement of the components and steps, numerical expressions and numerical values described in these embodiments do not limit the scope of the present application.
[0015] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present application, its application, or uses.
[0016] Technologies, systems, and devices known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, systems, and devices should be considered part of the specification.
[0017] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0018] Unless otherwise defined, technical or scientific terms used in the present invention shall have the common meanings understood by one having ordinary skills in the field to which the present invention belongs.
[0019] The main purpose of the present invention is to solve some defects existing in the existing image compression technology, especially the problem that when compressing images in machine vision applications, the relationship between the image volume after compression and the retention of effective visual data information of the image is not fully considered, and then compressing the image according to a fixed compression ratio leads to the loss of effective visual information after image compression.
[0020] The present invention provides a comprehensive quality-preserving compression method for multiple images based on entropy value analysis, S1, performing information entropy analysis on images generated in machine vision applications to obtain information entropy of the images; Information entropy is a statistical measure of the amount of information. For images, information entropy can be regarded as a quantitative indicator of the complexity of the image visual data content, reflecting the diversity and uncertainty of image information. The two-dimensional information entropy of an image pays special attention to the spatial relationship between pixels in the image, providing a method for compression methods to measure the complexity of image structure. To indicate application An image processing task is generated for a specific visual data , first calculate the two-dimensional entropy (amount of information) of the image. The entropy can be written as: ; here Represents the image information entropy calculation function, which can be specifically expressed as: ; In this function, Represents pixel pairs The probability of appearing in the picture is calculated as follows: ; In the above formula, the pixel pair middle represents the gray value of the center pixel in the sliding window, b is the average gray value of the pixels in the sliding window excluding the central pixel, Is a pixel pair The frequency of occurrence of all pixels in the entire image, is the number of pixels, For a specific visual data processing task, it is equivalent to a picture. In Indicates the order of the images themselves, for example, an application generates a total of picture, the order of this picture is i.
[0021] Through the above formula, the present invention obtains the information entropy of the picture.
[0022] Next, we combine it with reinforcement learning technology to achieve the best compression method for images in machine vision applications. DQN Reinforcement learning algorithm, through DQN Through continuous learning and updating, a deep reinforcement learning neural network is trained to make the best compression decision based on the information entropy of the image, the image size, and the number of images n that need to be processed at the same time generated by the machine vision device, that is, DQN (Deep Reinforcement Learning) neural network.
[0023] S2, combining the information entropy, image size, and machine vision equipment with reinforcement learning technology, and obtaining the corresponding DQN Network, machine vision equipment DQN The network is used to process the generated images, obtain the target compression ratio, and obtain the target compression solution for images in machine vision applications.
[0024] Preferably, the specific content in S2 includes DQN Status state definition, DQN Action action Definition and DQN Rewards reward definition; Among them, DQN Status state The specific contents of the definition are: Defining states state for , where e represents the information entropy of the image, reflecting the complexity and information content of the image, s represents the original size of the image, and k represents the number of images that need to be processed by the machine vision device at the same time; Among them, DQN Action action The specific contents of the definition are: For an original image, DQN Made to it action for: ; Preferably, DQN Rewards reward The specific content is: For each image processing task , defining its process from generation, calculation of image information entropy, compression to specific application YOLO The time to complete the processing is The processing result accuracy is ; Define a specific image processing task After the processing is completed, the total number of images processed by the specific application is ; Then define a specific image processing task After being processed, DQN What you get reward for: .
[0025] Preferably, DQN The training steps of the network are: Step 1. Initialization DQN of Q Network and Experience Replay Pool D ; Step 2 starts multiple rounds of training; The specific contents of starting multiple rounds of training in step 2 are: Step 2.1: Get the first one from the external environment state ,for( , , ); Step 2.2 DQN An action is chosen randomly with probability ε, or a value of argmax_a'Q ( state,a' ) action, and record the selected action as ; Step 2.3 DQN Execute an action , get rewarded , and then get the new state from the outside world next_state , and then ( state , , , next_state ) tuples are stored in the experience replay pool D , the new state obtained from the outside world next_ state Set as Current state , check the experience replay pool at this time D ; If the experience replay pool is large enough, D Randomly select a small batch of transformations from state , , , next_state ), calculate for each transformation = + , then use Update the network Q for the loss; If this is not the last round of training, reduce the value of ε and repeat steps 2.1 to 2.3.
[0026] in, DQN The specific coding of network training is: initialization DQN network Q , Initialize experience replay pool D , for episode = 1 to M : Initialization state state = ( , , ) while not done: Select Action : Randomly select an action with probability ε Or 1-ε Probabilistic Action Selection = argmax_a'Q ( state,a' )
[0027] Execute an action , get rewarded and the new state next_state
[0028] Storage Conversion (state, , , next_state) To the experience replay pool D make state = next_state
[0029] Adequate experience replay pool: from D Randomly select a small batch of transformations from state, , , next_state ) For each transformation calculate: = +
[0030] use Update the network for the loss Q
[0031] Reduce ε (exploration rate).
[0032] After analyzing the information entropy, compression ratio and accuracy of compressed images in a large amount of image data, the following results can be obtained: Figure 1 The relationship between image entropy and accuracy under different compression ratios is shown. The results show that at the same compression ratio, images with high entropy have higher accuracy, indicating better image recognition performance. In addition, the results show that high entropy images have better accuracy at λ=0.9 than low entropy images at a compression ratio of λ=0.7. This means that images with higher entropy can better retain information, have greater compression potential, and thus achieve lower time consumption. These findings highlight the key role of entropy of visual data in determining the compression ratio of visual tasks.
[0033] DQN After the network is trained, it is tested on the test set to obtain the time consumption of each image processing task and the accuracy after processing. DQN of reward The calculation formula value to adjust the emphasis on time consumption and accuracy of image processing. The results are as follows: Figure 2 Shows different hour, reward The weighted gain in accuracy and time in = about 0.7, the weighted accuracy and weighted time are equal, indicating a reward is close to zero. When it is less than 0.7, reward Below zero, when When it is greater than 0.7, reward Exceeds zero. We set this equilibrium point to =0.7, indicating DQN The accuracy and time considerations are almost equal. In addition, we define =0.2 means DQN Focus primarily on time consumption, and =0.9 means DQN The main focus is on output accuracy. It is worth noting that there is no optimal compression ratio that applies to all situations. After sufficient training, DQN According to the different state Make the current state To make the best compression decision, you can choose the appropriate compression method according to the trainer's emphasis on time consumption and accuracy during training. Value to train the corresponding DQN network.
[0034] We also compared two other strategies, namely N-C :The images generated by each machine vision application are not compressed. Random : A random compression ratio is applied to each image generated by a machine vision application. The results are as follows: Figures 3 - 6 The cumulative distribution function of time and accuracy under low and high work intensity conditions is shown in Figure 2. The present invention observes that under high work intensity conditions, the maximum time can exceed 2.5 seconds, while under low work intensity conditions, the maximum time is about 1.5 seconds. This is due to the intensified competition for resources between different images under high work intensity conditions.
[0035] like Figure 4 and Figure 6 As shown, except =0.2 and =0.7 outside ( Indicates adjustment reward The weights of image accuracy and image processing time in the image are both in the parameter, all other algorithms have an accuracy higher than 0.8 for some tasks at both low and high workloads. This is because =0.2 and = 0.7 prioritizes time efficiency, resulting in lower accuracy.
[0036] Figure 3 and Figure 5 The time distributions under low and high workload conditions are shown in Figure 2. In low traffic, only the NC task exceeds 1 second, while =0.7, =0.9 and Random Most of them are between 0.9 and 1.0 seconds. Under high workload, due to fierce resource competition, =0.9, Random and N-C The task takes more than 2 seconds. =0.7 maintains a stable balance in both cases, and its cumulative distribution function curve is stable, with a maximum value significantly lower than N-C , which explains =0.7 advantage.
[0037] Figure 4 and Figure 6 The distribution of accuracy under two workload intensities is shown. = 0.2 shows almost no tasks with accuracy higher than 0.2. In the [0.4-0.6] range of high workload, Random and =0.7 are higher than =0.9 and N-C,illustrate =0.9 and N-C More tasks, higher accuracy, Random Worst performance, N-C The performance is the best. When the accuracy reaches 0.7, =0.9 and N-C The curves are almost the same, highlighting = 0.9 effectiveness in prioritizing accuracy.
[0038] The effectiveness of the proposed method in balancing time consumption and accuracy under various workload intensities is demonstrated. Under low workload intensities, it maintains low processing time and acceptable accuracy, while under high workload intensities, it adapts to the increased workload, ensuring efficient processing time while improving accuracy.
[0039] The present invention dynamically adjusts the compression ratio based on the information entropy of the images generated by machine vision applications. DQN Algorithms, using state state As the basis for dynamically adjusting the compression level, The information entropy of the image reflects the complexity and information content of the image; s represents the original size of the image, representing the visual data size of the visual data captured by the vehicle set; Represents the number of images that need to be processed by the machine vision device at the same time.
[0040] Based on this status information, DQN Ability to compress ratio sets (such as 1.0、0.9、0.8 Select the optimal compression ratio in the image compression process (such as , etc.) to ensure that the visual image automatically optimizes the image compression ratio according to the different real-time work intensity.
[0041] Finally, it should be noted that the above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical method of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical method to deviate from the spirit and scope of the technical method of the present invention.
Claims
1. A comprehensive quality-preserving compression method for multiple images based on entropy analysis, characterized in that: The following steps are involved: S1. Perform information entropy analysis on the images generated in the machine vision application to obtain the information entropy of the images; S2, combining the information entropy, image size, and machine vision equipment with reinforcement learning technology, and obtaining the corresponding DQN Network, machine vision equipment DQN The network is used to process the generated images, obtain the target compression ratio, and obtain the target compression solution for images in machine vision applications.
2. The method for comprehensive quality-preserving compression of multiple images based on entropy analysis according to claim 1, characterized in that: The information entropy of the pictures generated in machine vision applications is analyzed and calculated, and the expression of the information entropy of the pictures is: ; in, is the information entropy of the image, Represents pixel pairs The probability of appearing in the image.
3. The method for comprehensive quality-preserving compression of multiple images based on entropy analysis according to claim 2, characterized in that: in, The calculation formula is as follows: ; Among them, the pixel pair middle represents the gray value of the center pixel in the sliding window, b is the average gray value of the pixels in the sliding window excluding the central pixel, Is a pixel pair The frequency of occurrence of all pixels in the entire image, is the number of pixels, For a specific visual data processing task, it is equivalent to a picture. The i in represents the order of the pictures themselves.
4. The method for comprehensive quality-preserving compression of multiple images based on entropy analysis according to claim 3 is characterized in that: The specific contents of S2 include DQN Status state definition, DQN Action action Definition and DQN Rewards reward definition.
5. The method for comprehensive quality-preserving compression of multiple images based on entropy analysis according to claim 4, characterized in that: right DQN Status state The specific contents of the definition are: Defining states state for( e,s,k ),in e The information entropy of the image reflects the complexity and amount of information in the image. s Represents the original size of the image, k Represents the number of images that need to be processed by the machine vision device at the same time.
6. The method for comprehensive quality-preserving compression of multiple images based on entropy analysis according to claim 5, characterized in that: right DQN Action action The specific contents of the definition are: For an original image, DQN Made to it action for: 。 7. The method for comprehensive quality-preserving compression of multiple images based on entropy analysis according to claim 6, characterized in that: DQN Rewards reward The specific content is: For image processing tasks , define the image processing task From generating, calculating image information entropy, compressing to being used for specific applications YOLO The processing time is The processing result accuracy is ; Defining image processing tasks After the processing is completed, the total number of images processed by the specific application is .
8. The method for comprehensive quality-preserving compression of multiple images based on entropy analysis according to claim 7, characterized in that: Defining image processing tasks After being processed, DQN What you get reward for: ; in, To adjust the weights of image accuracy and image processing time in reward, For the order of pictures, For the The total number of images processed by a specific application after the images are processed.
9. The method for comprehensive quality-preserving compression of multiple images based on entropy analysis according to claim 8, characterized in that: DQN The network training steps are: Step 1. Initialization DQN of Q Network and Experience Replay Pool D ; Step 2 starts multiple rounds of training.
10. The method for comprehensive quality-preserving compression of multiple images based on entropy analysis according to claim 9, characterized in that: The specific contents of starting multiple rounds of training in step 2 are: Step 2.1: Get the first one from the external environment state ,for( , , ),in Represents visual data processing tasks The information entropy of the picture in Represents visual data processing tasks The original size of the image in Indicates the total number of images that need to be processed when the machine vision device generates the image; Step 2.2 DQN have ε The probability of randomly selecting an action is 1- ε The probability of choosing a value is argmax_a'Q ( state,a' ) action, where a' Express Q ( state,a' ) has the largest value, and the selected action is recorded as ; Step 2.3 DQN Execute an action , get rewarded , and then get the new state from the outside world next_state , and then ( state, , ,next_state ) tuples are stored in the experience replay pool D , the new state obtained from the outside world next_state Set as Current state , check the experience replay pool at this time D ; If the experience replay pool is large enough, D Randomly select a small batch of transformations from state, , ,next_ state ), calculate for each transformation = + ,in is a discount factor, adjusting DQN The weight of future rewards in , and then use Update the network for the loss Q ; If it is not the last round of training, reduce ε Repeat steps 2.1 to 2.3 for the values of
Citation Information
Patent Citations
Picture dynamic adaptive compression method based on reinforcement learning
CN110210548A
Machine learning model compression method, device and equipment
CN112508187A
Motor adaptive control method and system based on deep reinforcement learning
CN118508817A
Image steganography method based on reinforcement learning
CN118628329A
Driving prediction with a deep neural network
EP3219564A1
Cited By
Image processing method and device, electronic equipment and computer readable storage medium
CN120730073A