A method and device for compressing, decompressing and transmitting visual images of underwater robots

By introducing a reparameterized attention module into the underwater robot visual image compression model, the problems of low compression magnification and poor reconstruction performance in the prior art are solved, and higher image reconstruction fidelity and compression performance are achieved.

CN119484831BActive Publication Date: 2025-04-25ZHEJIANG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510061350.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-04-25
Estimated Expiration
2045-01-15

Smart Images

  • Figure CN119484831B_ABST
    Figure CN119484831B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for compressing, decompressing and transmitting visual images of an underwater robot. The method includes constructing an image compression model for compressing visual images of the underwater robot, training the image compression model, constructing a visual image encoding end based on the trained image compression model, compressing and encoding the visual image of the underwater robot using the visual image encoding end, generating code stream data to complete the compression of the visual image of the underwater robot, and constructing a visual image decoding end based on the trained image compression model. The visual image decoding end is used to decode the code stream data and reconstruct the image to generate a reconstructed visual image of the underwater robot. The underwater robot visual image compression and decompression method proposed by the present invention has a high compression ratio and good image reconstruction performance, and can be applied to the compression and transmission tasks of the visual image of the underwater robot.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of image compression coding, and in particular relates to a method and a device for compressing, decompressing and transmitting visual images of an underwater robot. Background Art

[0002] In recent years, as the country vigorously develops its efforts in ocean exploration and resource development, underwater robots have become a hot topic of research. Visual images are one of the most important forms of perception of the external environment for underwater robots. In underwater rescue missions, seabed resource exploration, underwater archaeology and other tasks, most of the image data collected by underwater robots need to be transmitted to ground workstations for systematic analysis. However, the transmission bandwidth between underwater robots and the ground is limited, making it difficult to achieve fast real-time transmission of large-scale visual images. Underwater image compression technology can significantly improve the efficiency of data transmission, storage and processing. However, due to the special complexity of the underwater environment, underwater robots are usually accompanied by a large number of external interference factors when performing image acquisition, such as light attenuation, color deviation, turbidity, etc. These interferences will seriously affect the image compression performance.

[0003] At present, mainstream compression methods include traditional methods represented by discrete cosine transform JPEG2000 and image compression methods based on deep learning. However, due to the complexity of the underwater environment, existing compression methods and systems often have problems such as low compression ratio and poor reconstruction performance, which makes it difficult to ensure the fidelity of ground reconstruction images and affects subsequent image analysis tasks. Summary of the invention

[0004] In order to solve the problems existing in the background technology, the purpose of the present invention is to provide a method and device for compressing, decompressing and transmitting visual images of an underwater robot, so as to solve the problems that the existing compression methods often have low compression ratio and poor reconstruction performance.

[0005] The technical solution adopted by the present invention is as follows:

[0006] 1. A method for compressing visual images of an underwater robot, comprising the following steps:

[0007] Step S1) constructing an image compression model for underwater robot visual image compression in a computer;

[0008] The image compression model is mainly composed of an encoder, a decoder, a sub-encoder, a sub-decoder, a quantization module and an entropy model; the encoder, the decoder, the sub-encoder and the sub-decoder are all loaded with a re-parameterized attention module;

[0009] Step S2) using a processor to train an image compression model;

[0010] Step S3) The processor constructs a visual image encoding end based on the trained image compression model, and uses the visual image encoding end to compress and encode the visual image of the underwater robot to generate code stream data to complete the compression of the visual image of the underwater robot.

[0011] The image compression model includes an encoder, a sub-encoder, a quantization module Q, a decoder, a sub-decoder, an entropy model, a first entropy coding module, a first entropy decoding module, a second entropy coding module and a second entropy decoding module; the encoder is used to extract features from an input underwater robot visual image x to obtain an initial potential representation y corresponding to the underwater robot visual image x; the sub-encoder is used to extract features from the initial potential representation y to generate an initial sub-potential representation z; the quantization module Q is used to quantize the initial potential representation y and the initial sub-potential representation z respectively, and generate a quantized quantized potential representation y h and the quantized sub-latent representation z h The first entropy coding module is used to quantize the potential representation z h Encode and get the sub-representation code stream z m The first entropy decoding module is used to decode the sub-representation code stream z m Decode and get the quantized sub-latent representation z again h ; The sub-decoder is used to quantize the sub-potential representation z h Feature decoding is performed to obtain edge information s; the entropy model is used to quantize the potential representation y according to the edge information s h Make distribution predictions and construct quantitative potential representations y h The second entropy coding module is used to quantize the potential representation y according to the Gaussian distribution probability model h Encode and get the representation code stream y m The second entropy decoding module is used to represent the bit stream y according to the Gaussian distribution probability model m Decode and retrieve the quantized potential representation y h ; The decoder is used to quantize the potential representation y h Feature decoding is performed to reconstruct the image.

[0012] The output end of the last convolutional layer in the encoder and the sub-encoder is connected to a re-parameterized attention module, and the input end of the first convolutional layer in the decoder and the sub-decoder is connected to a re-parameterized attention module, and the re-parameterized attention module is used to re-parameterize the input feature map. The re-parameterization steps of the re-parameterized attention module are as follows:

[0013] 1) First, for the input feature map inp, obtain the mean µ and variance σ of each feature map inp 2 ;

[0014] 2) Then, according to the mean µ and variance σ of the feature map inp 2 According to the following formula, the new feature map outp is obtained and output:

[0015] outp=inp+φ*inp;φ=1 / (1+e -k ); k = mu + No * sigma

[0016] mu=W1*µ+b1;sigma=W2*σ 2 +b2;

[0017] Among them, outp represents the output of the reparameterized attention module; inp represents the input of the reparameterized attention module; φ represents the nonlinear activation parameter; k represents the reparameterized parameter; mu represents the mean feature; No represents random noise; sigma represents the variance feature; W1, W2, b1 and b2 are all weight parameters of the fully connected layer in the reparameterized attention module.

[0018] The visual image encoding end in step S3) is constructed based on the trained image compression model, including a trained encoder, a sub-encoder, a quantization module, a sub-decoder, an entropy model, a first entropy encoding module and a second entropy encoding module. The visual image encoding end is used to compress and encode the visual image of the underwater robot to generate code stream data. The specific method of obtaining the code stream data is as follows:

[0019] First, the underwater robot visual image x is input to the encoder of the visual image encoding end. The encoder extracts the features of the input underwater robot visual image x to obtain the initial potential representation y corresponding to the underwater robot visual image x. Then, the quantization module is used to quantize the initial potential representation y and generate the quantized quantized potential representation y. h At the same time, the sub-encoder is used to extract features from the initial potential representation y to generate an initial sub-potential representation z, and the quantization module is used to quantize the initial sub-potential representation z to generate a quantized sub-potential representation z h , using the first entropy coding module to quantize the potential representation z h Encode and get the sub-representation code stream z m , and use the sub-decoder to quantize the sub-latent representation z h Perform feature decoding to obtain edge information s, and then use the entropy model to quantize the potential representation y according to the edge information s h Make distribution predictions and construct quantitative potential representations y h The corresponding Gaussian distribution probability model, and then the second entropy coding module quantizes the potential representation y according to the Gaussian distribution probability model h Encode and get the representation code stream y m , the sub-representation code stream zm and characterize the bitstream y m The data are merged to obtain code stream data and output to complete the compression of the underwater robot's visual image.

[0020] 2. A method for decompressing a visual image of an underwater robot, the method decoding image data to be decompressed, reconstructing the decoded data, and obtaining a reconstructed visual image of the underwater robot, wherein the image data to be decompressed is code stream data obtained by compression using the above compression method, and the method comprising:

[0021] The processor constructs a visual image decoding end based on the trained image compression model, including a trained decoder, a sub-decoder, an entropy model, a first entropy decoding module and a second entropy decoding module. The visual image decoding end is used to decode the code stream data and reconstruct the image to generate a reconstructed underwater robot visual image. The specific method of obtaining the reconstructed underwater robot visual image is as follows:

[0022] First, the code stream data corresponding to the visual image of the underwater robot is input to the input end of the visual image decoding end, and the sub-representation code stream z in the code stream data is decoded by the first entropy decoding module. m Decode and get the quantized sub-potential representation z h , and then use the sub-decoder to quantize the sub-latent representation z h Feature decoding is performed to obtain edge information s, and then the entropy model is used to quantize the potential representation y according to the edge information s h Make distribution predictions and construct quantitative potential representations y h The corresponding Gaussian distribution probability model, and then the second entropy decoding module decodes the representation code stream y in the code stream data according to the Gaussian distribution probability model m Decode and get the quantized potential representation y h ; Finally, the decoder decodes the quantized potential representation y after entropy decoding h Feature decoding is performed to reconstruct the underwater robot visual image and output it.

[0023] 3. A method for transmitting visual images of an underwater robot, the method comprising:

[0024] The above compression method is used to compress and encode the underwater robot visual image collected in real time; and the above decompression method is used to decompress the code stream data.

[0025] 4. A compression device for implementing the compression method:

[0026] It includes an encoder, which is used to extract features from an input underwater robot visual image x to obtain an initial potential representation y corresponding to the underwater robot visual image x;

[0027] including a sub-encoder for extracting features from the initial latent representation y to generate an initial sub-latent representation z;

[0028] It includes a quantization module for quantizing the initial potential representation y and the initial sub-potential representation z to generate quantized quantized potential representations y h and the quantized sub-latent representation z h ;

[0029] A first entropy coding module is included to quantize the potential representation z h Encode and get the sub-representation code stream z m ;

[0030] Includes a sub-decoder for quantizing the sub-latent representation z h Perform feature decoding to obtain edge information s;

[0031] Includes an entropy model to quantize the potential representation y based on the edge information s h Make distribution predictions and construct quantitative potential representations y h The corresponding Gaussian distribution probability model;

[0032] A second entropy coding module is included for quantizing the potential representation y according to a Gaussian distribution probability model h Encode and get the representation code stream y m .

[0033] 5. A decompression device used in the decompression method:

[0034] A first entropy decoding module is included for decoding the sub-representation code stream z m Decode and get the quantized sub-potential representation z h ;

[0035] Includes a sub-decoder for quantizing the sub-latent representation z h Perform feature decoding to obtain edge information s;

[0036] Includes an entropy model to quantize the potential representation y based on the edge information s h Make distribution predictions and construct quantitative potential representations y h The corresponding Gaussian distribution probability model;

[0037] A second entropy decoding module is included for decoding the characterization bit stream y according to a Gaussian distribution probability model. m Decode and get the quantized potential representation y h ;

[0038] Includes a decoder for entropy decoding the quantized latent representation y h Feature decoding is performed to reconstruct the image.

[0039] The re-parameterized attention module provided by the present invention has the following two advantages: first, the re-parameterized attention module can effectively remove redundant information of the input feature map and improve the compression ratio of the model; second, the re-parameterized attention module is a general module that can be applied to other image compression models. The underwater robot visual image compression, decompression and transmission method provided by the present invention solves the problem that traditional algorithms cannot effectively adapt to underwater environment image compression. The compression method of the present invention has much better performance than the traditional JPEG2000 compression method, and effectively ensures the rapid transmission of underwater robot visual images. The scheme has the characteristics of good compression performance and easy implementation.

[0040] The beneficial effects of the present invention are:

[0041] 1. The method of the present invention can effectively remove redundant information and retain valid information by setting a re-parameterized attention module, and can achieve high-fidelity reconstruction by connecting the re-parameterized attention module to the encoder, decoder, sub-encoder and sub-decoder.

[0042] 2. The method of the present invention has strong versatility and practicality, and can adapt to high compression ratio compression transmission of images in complex underwater environments.

[0043] 3. The solution of the present invention is simple and convenient to implement and has strong versatility. It solves the problems of low practicality and inconvenience in actual application of underwater robot related technologies, can improve user experience, and has important market application value in scenarios such as marine resource exploration and underwater operations. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 is a schematic diagram of a visual image compression model of an underwater robot according to an embodiment of the present invention;

[0045] Figure 2 is a schematic diagram of a re-parameterized attention module according to an embodiment of the present invention;

[0046] Figure 3 1 is a schematic diagram of a process flow of a visual image encoding end of an underwater robot according to an embodiment of the present invention;

[0047] Figure 4 This is a diagram showing the process of the ground decoding end according to an embodiment of the present invention;

[0048] Figure 5 4 is a comparison diagram of rate-distortion results of an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The present invention is described in detail below in conjunction with specific implementation cases. The following implementation cases will help those skilled in the art to further understand the present invention, but will not limit the present invention in any form.

[0050] An embodiment of the present invention comprises the following steps:

[0051] Step S1) constructing an image compression model for underwater robot visual image compression in a computer;

[0052] The image compression model is mainly composed of an encoder, a decoder, a sub-encoder, a sub-decoder, a quantization module and an entropy model; the encoder, decoder, sub-encoder and sub-decoder are all loaded with a re-parameterized attention module, which is used to improve the compression performance of the model;

[0053] Step S2) training the image compression model using a processor. The image compression model training in step S2) includes training on a preset underwater image data set. In particular, the hardware platform of this embodiment requires a GPU as an accelerated computing platform, and the software platform includes third-party libraries such as Python, Pytorch, and OpenCV.

[0054] Step S3) The processor constructs a visual image encoding end based on the trained image compression model, and uses the visual image encoding end to compress and encode the visual image of the underwater robot to generate code stream data to complete the compression of the visual image of the underwater robot;

[0055] Step S4) The processor constructs a visual image decoding end based on the trained image compression model, and the visual image decoding end is used to decode the code stream data and reconstruct the image to generate a reconstructed underwater robot visual image.

[0056] like Figure 1 As shown, the image compression model includes an encoder, a sub-encoder, a quantization module Q, a decoder, a sub-decoder, an entropy model, a first entropy coding module, a first entropy decoding module, a second entropy coding module and a second entropy decoding module; the encoder is used to extract features from the input underwater robot visual image x to obtain an initial potential representation y corresponding to the underwater robot visual image x; the sub-encoder is used to extract features from the initial potential representation y to generate an initial sub-potential representation z; the quantization module Q is used to quantize the initial potential representation y and the initial sub-potential representation z respectively, and generate a quantized quantized potential representation y h and the quantized sub-latent representation z h ; The first entropy coding module is used to quantize the potential representation z h Encode and get the sub-representation code stream z m ; The first entropy decoding module is used to represent the sub-code stream z m Decode and get the quantized sub-latent representation z again h ; The sub-decoder is used to decode the quantized sub-potential representation z h Feature decoding is performed to obtain edge information s; the entropy model is used to quantize the potential representation y according to the edge information s hMake distribution predictions and construct quantitative potential representations y h The second entropy coding module is used to quantize the potential representation y according to the Gaussian distribution probability model h Encode and get the representation code stream y m The second entropy decoding module is used to characterize the bit stream y according to the Gaussian distribution probability model m Decode and retrieve the quantized potential representation y h ; The decoder is used to decode the quantized potential representation y h Feature decoding is performed to reconstruct the image.

[0057] In a specific implementation, the underwater robot visual image x is input to the encoder of the image compression model, and the encoder extracts features from the input underwater robot visual image x to obtain the initial potential representation y corresponding to the underwater robot visual image x, and then uses the quantization module to quantize the initial potential representation y and generate the quantized quantized potential representation y h At the same time, the sub-encoder is used to extract features from the initial potential representation y to generate an initial sub-potential representation z, and the quantization module is used to quantize the initial sub-potential representation z to generate a quantized sub-potential representation z h , using the first entropy coding module to quantize the potential representation z h Encode and get the sub-representation code stream z m , and then use the first entropy decoding module to represent the sub-code stream z m Decode and get the quantized sub-latent representation z again h , and then use the sub-decoder to entropy decode the quantized sub-latent representation z h Perform feature decoding to obtain edge information s, and use the entropy model to quantize the potential representation y according to the edge information s h Make distribution predictions and construct quantitative potential representations y h The corresponding Gaussian distribution probability model (µ',σ' 2 ); The second entropy coding module quantizes the potential representation y according to the Gaussian distribution probability model h Encode and get the representation code stream y m Then the second entropy decoding module characterizes the bit stream y according to the Gaussian distribution probability model m Decode and retrieve the quantized potential representation y h ; Finally, the decoder decodes the quantized potential representation y after entropy decoding h Perform feature decoding to reconstruct the image, and convert the reconstructed underwater robot visual image x h As the output of the image compression model.

[0058] The function expression of the quantization module Q is as follows:

[0059] When the image compression model is in the training stage, Q(a)=a+ noise;

[0060] When the image compression model is in the inference stage, Q(a) = a + round(a);

[0061] Among them, Q(a) represents the quantization process function; a represents the quantization variable; noise represents uniformly distributed noise with a value range of [0,1]; and round(a) represents the rounding function.

[0062] In the specific implementation, the output end of the last convolutional layer in the encoder and the sub-encoder is connected to the re-parameterized attention module, and the input end of the first convolutional layer in the decoder and the sub-decoder is connected to the re-parameterized attention module. The re-parameterized attention module is used to re-parameterize the input feature map. The schematic diagram of the re-parameterized attention module is shown in Figure 2 As shown in Figure 2, the reparameterization steps of the reparameterized attention module are as follows:

[0063] 1) First, for the input feature map inp, obtain the mean µ and variance σ of each feature map inp 2 ;

[0064] 2) Then, according to the mean µ and variance σ of the feature map inp 2 According to the following formula, the new feature map outp is obtained and output:

[0065] outp=inp+φ*inp;φ=1 / (1+e -k ); k = mu + No * sigma

[0066] mu=W1*µ+b1;sigma=W2*σ 2 +b2;

[0067] Among them, outp represents the output of the reparameterized attention module; inp represents the input of the reparameterized attention module; φ represents the nonlinear activation parameter; e represents a natural number; k represents the reparameterized parameter; mu represents the mean feature; No represents random noise, and No obeys the uniform distribution of N(0,1); sigma represents the variance feature; W1, W2, b1 and b2 are all given weight parameters of the fully connected layer in the reparameterized attention module.

[0068] Specifically, the way to reparameterize the attention module output feature map is as follows:

[0069] 1) First, get the mean µ and variance σ of the input feature map inp 2 ;

[0070] 2) Then use the fully connected layer f 1 (µ) and the fully connected layer f2 (σ 2 ) respectively for the mean µ and variance σ 2 Perform parameterized learning to obtain new mean feature mu and variance feature sigma. The formula is as follows:

[0071] mu=W1*µ+b1;sigma=W2*σ 2 +b2;

[0072] Among them, W1, W2, b1 and b2 are all known weight parameters of the fully connected layer;

[0073] 3) Reparameterize the mean feature mu and variance feature sigma, the formula is as follows:

[0074] k=mu+No*sigma

[0075] Among them, No is random noise, and No~N(0,1);

[0076] 4) Use the Sigmoid function for nonlinear activation. The formula is as follows:

[0077] φ=1 / (1+e -k )

[0078] 5) Generate a new feature map outp, the formula is as follows:

[0079] outp=inp+φ*inp

[0080] Among them, outp represents the output result of the re-parameterized attention module.

[0081] in, Figure 2 The × in represents the fusion process of the feature map inp and the nonlinear activation parameter φ.

[0082] The visual image encoding end in step S3) is constructed based on the trained image compression model, including a trained encoder, a sub-encoder, a quantization module, a sub-decoder, an entropy model, a first entropy encoding module and a second entropy encoding module. The visual image encoding end is used to compress and encode the visual image of the underwater robot to generate code stream data. The specific method of obtaining the code stream data is as follows: Figure 3 As shown:

[0083] First, the underwater robot visual image x is input to the encoder of the visual image encoding end. The encoder extracts the features of the input underwater robot visual image x to obtain the initial potential representation y corresponding to the underwater robot visual image x. Then, the quantization module is used to quantize the initial potential representation y and generate the quantized quantized potential representation y. hAt the same time, the sub-encoder is used to extract features from the initial potential representation y to generate an initial sub-potential representation z, and the quantization module is used to quantize the initial sub-potential representation z to generate a quantized sub-potential representation z h , using the first entropy coding module to quantize the potential representation z h Encode and get the sub-representation code stream z m , and use the sub-decoder to quantize the sub-latent representation z h Perform feature decoding to obtain edge information s, and then use the entropy model to quantize the potential representation y according to the edge information s h Make distribution predictions and construct quantitative potential representations y h The corresponding Gaussian distribution probability model, and then the second entropy coding module quantizes the potential representation y according to the Gaussian distribution probability model h Encode and get the representation code stream y m , the sub-representation code stream z m and characterize the bitstream y m The data are merged to obtain code stream data and output to complete the compression of the underwater robot's visual image.

[0084] That is, the code stream data contains the sub-representation code stream z m and characterize the bitstream y m data.

[0085] The visual image decoding end in step S4) is constructed based on the trained image compression model, including a trained decoder, a sub-decoder, an entropy model, a first entropy decoding module and a second entropy decoding module. The visual image decoding end is used to decode the bitstream data and reconstruct the image to generate a reconstructed underwater robot visual image. The specific method of obtaining the reconstructed underwater robot visual image is as follows: Figure 4 As shown:

[0086] First, the code stream data corresponding to the visual image of the underwater robot is input to the input end of the visual image decoding end, and the sub-representation code stream z in the code stream data is decoded by the first entropy decoding module. m Decode and get the quantized sub-potential representation z h , and then use the sub-decoder to decode the quantized sub-latent representation z after entropy decoding h Feature decoding is performed to obtain edge information s, and then the entropy model is used to quantize the potential representation y according to the edge information s h Make distribution predictions and construct quantitative potential representations y h The corresponding Gaussian distribution probability model, and then the second entropy decoding module decodes the representation code stream y in the code stream data according to the Gaussian distribution probability model m Decode and get the quantized potential representation y h ; Finally, the decoder decodes the quantized potential representation y after entropy decoding hFeature decoding is performed to reconstruct the underwater robot visual image and output it.

[0087] The compression device used in the present invention includes an encoder for extracting features from an input underwater robot visual image x to obtain an initial potential representation y corresponding to the underwater robot visual image x; a sub-encoder for extracting features from the initial potential representation y to generate an initial sub-potential representation z; and a quantization module for quantizing the initial potential representation y and the initial sub-potential representation z to generate quantized quantized potential representations y respectively. h and the quantized sub-latent representation z h ; comprising a first entropy coding module for quantizing the potential representation z h Encode and get the sub-representation code stream z m ; includes a sub-decoder for quantizing the sub-latent representation z h Perform feature decoding to obtain edge information s; include an entropy model for quantizing the potential representation y based on the edge information s h Make distribution predictions and construct quantitative potential representations y h corresponding Gaussian distribution probability model; comprising a second entropy coding module for quantizing the potential representation y according to the Gaussian distribution probability model h Encode and get the representation code stream y m .

[0088] The decompression device used in the present invention comprises a first entropy decoding module for decoding the sub-representation code stream z m Decode and get the quantized sub-potential representation z h ; includes a sub-decoder for quantizing the sub-latent representation z h Perform feature decoding to obtain edge information s; include an entropy model for quantizing the potential representation y based on the edge information s h Make distribution predictions and construct quantitative potential representations y h A corresponding Gaussian distribution probability model; comprising a second entropy decoding module for characterizing the bit stream y according to the Gaussian distribution probability model m Decode and get the quantized potential representation y h ; including a decoder for entropy decoding the quantized latent representation y h Feature decoding is performed to reconstruct the image.

[0089] In specific implementation, the underwater robot visual image compression and decompression method proposed in the technical solution of the present invention can be automatically operated by technical personnel in this field using computer software technology. System devices for implementing the method, such as computer-readable storage media that store the corresponding computer program of the technical solution of the present invention and computer equipment that runs the corresponding computer program, should also be within the scope of protection of the present invention.

[0090] The present invention also provides an underwater robot visual image transmission method, wherein the encoding method of the underwater robot visual image transmission method includes the aforementioned underwater robot visual image compression method; and the decoding method of the transmission method includes the aforementioned visual image decompression method.

[0091] In order to facilitate understanding of the technical effects of the present invention, an application comparison between the present invention and the traditional method JPEG2000 is provided. Figure 5 shown. Figure 5 The comparison of rate-distortion curves before and after compression of different compression methods is shown. The horizontal axis represents the bit rate BPP, and the vertical axis represents the peak signal-to-noise ratio PSNR. The smaller the bit rate BPP and the higher the peak signal-to-noise ratio PSNR, the better the compression method performance. Figure 5 As shown, the method proposed in the present invention can achieve higher image reconstruction performance with a lower bit rate.

[0092] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for compressing visual images of an underwater robot, characterized in that: The following steps are involved: Step S1) constructing an image compression model for underwater robot visual image compression in a computer; The image compression model is mainly composed of an encoder, a decoder, a sub-encoder, a sub-decoder, a quantization module and an entropy model; the encoder, the decoder, the sub-encoder and the sub-decoder are all loaded with a re-parameterized attention module; Step S2) using a processor to train an image compression model; Step S3) the processor constructs a visual image encoding end based on the trained image compression model, and uses the visual image encoding end to compress and encode the visual image of the underwater robot to generate code stream data to complete the compression of the visual image of the underwater robot; The image compression model includes an encoder, a sub-encoder, a quantization module Q, a decoder, a sub-decoder, an entropy model, a first entropy coding module, a first entropy decoding module, a second entropy coding module and a second entropy decoding module; the encoder is used to extract features from an input underwater robot visual image x to obtain an initial potential representation y corresponding to the underwater robot visual image x; the sub-encoder is used to extract features from the initial potential representation y to generate an initial sub-potential representation z; the quantization module Q is used to quantize the initial potential representation y and the initial sub-potential representation z respectively, and generate a quantized quantized potential representation y h and the quantized sub-latent representation z h The first entropy coding module is used to quantize the potential representation z h Encode and get the sub-representation code stream z m The first entropy decoding module is used to decode the sub-representation code stream z m Decode and get the quantized sub-latent representation z again h ; The sub-decoder is used to quantize the sub-potential representation z h Feature decoding is performed to obtain edge information s; the entropy model is used to quantize the potential representation y according to the edge information s h Make distribution predictions and construct quantitative potential representations y h The second entropy coding module is used to quantize the potential representation y according to the Gaussian distribution probability model h Encode and get the representation code stream y m The second entropy decoding module is used to represent the bit stream y according to the Gaussian distribution probability model m Decode and retrieve the quantized potential representation y h ; The decoder is used to quantize the potential representation y h Perform feature decoding to reconstruct the image; The output end of the last convolutional layer in the encoder and the sub-encoder is connected to a re-parameterized attention module, and the input end of the first convolutional layer in the decoder and the sub-decoder is connected to a re-parameterized attention module, and the re-parameterized attention module is used to re-parameterize the input feature map. The re-parameterization steps of the re-parameterized attention module are as follows: 1) First, for the input feature map inp, obtain the mean µ and variance σ of each feature map inp 2 ; 2) Then, according to the mean µ and variance σ of the feature map inp 2 According to the following formula, the new feature map outp is obtained and output: outp=inp+φ*inp;φ=1 / (1+e -k );k=mu+No*sigma mu=W1*µ+b1;sigma=W2*σ 2 +b2; Among them, outp represents the output of the reparameterized attention module; inp represents the input of the reparameterized attention module; φ represents the nonlinear activation parameter; k represents the reparameterization parameter; mu represents the mean feature; No represents random noise; sigma represents the variance feature; W1, W2, b1 and b2 are the weight parameters of the fully connected layer in the reparameterized attention module.

2. The underwater robot visual image compression method according to claim 1, characterized in that: The visual image encoding end in step S3) is constructed based on the trained image compression model, including a trained encoder, a sub-encoder, a quantization module, a sub-decoder, an entropy model, a first entropy encoding module and a second entropy encoding module. The visual image encoding end is used to compress and encode the visual image of the underwater robot to generate code stream data. The specific method of obtaining the code stream data is as follows: First, the underwater robot visual image x is input to the encoder of the visual image encoding end. The encoder extracts the features of the input underwater robot visual image x to obtain the initial potential representation y corresponding to the underwater robot visual image x. Then, the quantization module is used to quantize the initial potential representation y and generate the quantized quantized potential representation y. h At the same time, the sub-encoder is used to extract features from the initial potential representation y to generate an initial sub-potential representation z, and the quantization module is used to quantize the initial sub-potential representation z to generate a quantized sub-potential representation z h , using the first entropy coding module to quantize the potential representation z h Encode and get the sub-representation code stream z m , and use the sub-decoder to quantize the sub-latent representation z h Perform feature decoding to obtain edge information s, and then use the entropy model to quantize the potential representation y according to the edge information s h Make distribution predictions and construct quantitative potential representations y h The corresponding Gaussian distribution probability model, and then the second entropy coding module quantizes the potential representation y according to the Gaussian distribution probability model h Encode and get the representation code stream y m , the sub-representation code stream z m and characterize the bitstream y m The data are merged to obtain code stream data and output to complete the compression of the underwater robot's visual image.

3. A method for decompressing visual images of an underwater robot, characterized in that: The decompression method decodes the image data to be decompressed, reconstructs the decoded data, and obtains a reconstructed visual image of the underwater robot, wherein the image data to be decompressed is code stream data obtained by compressing the image data using the compression method according to any one of claims 1 to 2, and the decompression method includes: The processor constructs a visual image decoding end based on the trained image compression model, including a trained decoder, a sub-decoder, an entropy model, a first entropy decoding module and a second entropy decoding module. The visual image decoding end is used to decode the code stream data and reconstruct the image to generate a reconstructed underwater robot visual image. The specific method of obtaining the reconstructed underwater robot visual image is as follows: First, the code stream data corresponding to the visual image of the underwater robot is input to the input end of the visual image decoding end, and the sub-representation code stream z in the code stream data is decoded by the first entropy decoding module. m Decode and get the quantized sub-potential representation z h , and then use the sub-decoder to quantize the sub-latent representation z h Feature decoding is performed to obtain edge information s, and then the entropy model is used to quantize the potential representation y according to the edge information s h Make distribution predictions and construct quantitative potential representations y h The corresponding Gaussian distribution probability model, and then the second entropy decoding module decodes the representation code stream y in the code stream data according to the Gaussian distribution probability model m Decode and get the quantized potential representation y h ; Finally, the decoder decodes the quantized potential representation y after entropy decoding h Feature decoding is performed to reconstruct the underwater robot visual image and output it.

4. A method for transmitting visual images of an underwater robot, characterized in that: The transmission method comprises: The underwater robot visual image collected in real time is compressed and encoded by using the compression method described in any one of claims 1-2; and the code stream data is decompressed by using the decompression method described in claim 3.

5. A compression device for implementing the compression method according to any one of claims 1 to 2, characterized in that: It includes an encoder, which is used to extract features from an input underwater robot visual image x to obtain an initial potential representation y corresponding to the underwater robot visual image x; including a sub-encoder for extracting features from the initial latent representation y to generate an initial sub-latent representation z; It includes a quantization module for quantizing the initial potential representation y and the initial sub-potential representation z to generate quantized quantized potential representations y h and the quantized sub-latent representation z h ; A first entropy coding module is included to quantize the potential representation z h Encode and get the sub-representation code stream z m ; Includes a sub-decoder for quantizing the sub-latent representation z h Perform feature decoding to obtain edge information s; Includes an entropy model to quantize the potential representation y based on the edge information s h Make distribution predictions and construct quantitative potential representations y h The corresponding Gaussian distribution probability model; A second entropy coding module is included for quantizing the potential representation y according to a Gaussian distribution probability model h Encode and get the representation code stream y m .

6. A decompression device for implementing the decompression method according to claim 3, characterized in that: A first entropy decoding module is included for decoding the sub-representation code stream z m Decode and get the quantized sub-potential representation z h ; Includes a sub-decoder for quantizing the sub-latent representation z h Perform feature decoding to obtain edge information s; Includes an entropy model to quantize the potential representation y based on the edge information s h Make distribution predictions and construct quantitative potential representations y h The corresponding Gaussian distribution probability model; A second entropy decoding module is included for decoding the characterization bit stream y according to a Gaussian distribution probability model. m Decode and get the quantized potential representation y h ; include Decoder, used to entropy decode the quantized potential representation y h Feature decoding is performed to reconstruct the image.

Citation Information

Patent Citations

  • Mars image compression method and device, computer equipment and storage medium

    CN115063494A

  • River flood early warning method based on machine learning and multi-meteorological-mode fusion

    CN117992919A