Image processing method, and terminal
By using compression prediction network and residual network to decode feature maps in the image processing method, the problem of low accuracy of detection results in machine vision detection tasks is solved and the accuracy of detection results is significantly improved.
Patent Information
- Application Number
- PCT/CN2024/087659
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-05
- Filing Date
- 2024-04-15
- Publication Date
- 2024-10-24
AI Technical Summary
In machine vision inspection tasks, the accuracy of visual inspection results based on multi-scale architecture is low, resulting in poor detection results.
By using the compression prediction network and the residual network at the decoding end, the first code stream and the second code stream are decoded respectively to obtain the reconstructed feature map and the residual feature map, and the target feature map is determined based on these feature maps to reduce distortion and improve detection. accuracy of results.
The loss function of the residual network is determined based on the loss of the visual detection task, and then the reconstructed feature map is supplemented by the residual feature map, which significantly improves the accuracy of the detection results of the visual detection task and reduces the distortion of the target feature map.
Smart Images

Figure CN2024087659_24102024_PF_FP_ABST
Abstract
Description
Image processing method and terminal
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese patent application No. 202311143766.0 filed on September 5, 2023, and this application claims priority to Chinese patent application No. 202310435554.3 filed on April 21, 2023, the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present application belongs to the technical field of image compression and decompression, and specifically relates to an image processing method and terminal. Background Art
[0004] Machine vision inspection tasks typically rely on multi-scale architectures, such as the Mask Region-based Convolutional Neural Network (Mask R-CNN) architecture, to extract multiple feature maps corresponding to the original image. These feature maps are then compressed to produce a bitstream, which is then decoded to reconstruct feature maps. Visual inspection of the image is then performed based on the reconstructed feature maps. However, the accuracy of the detection results for these visual inspection tasks is relatively low.
[0005] Summary of the Invention
[0006] The embodiments of the present application provide an image processing method and terminal, which can solve the technical problem of low accuracy of detection results in visual detection tasks.
[0007] In a first aspect, an image processing method is provided, comprising:
[0008] The decoding end obtains a target code stream; the target code stream includes a first code stream and a second code stream;
[0009] The decoding end decodes the first bitstream through a compression prediction network to obtain N reconstructed feature maps, and decodes the second bitstream through a residual network to obtain N residual feature maps, wherein the N first feature maps correspond one-to-one to the N residual feature maps, and the residual feature maps are used to represent the residual between the corresponding reconstructed feature maps and the original feature maps. The loss function of the residual network is determined based on the loss generated by the visual detection task, and N is a positive integer greater than or equal to 2;
[0010] The decoding end determines N first target feature maps based on the N reconstructed feature maps and the N residual feature maps.
[0011] In a second aspect, an image processing method is provided, comprising:
[0012] The encoder obtains N original feature maps corresponding to the image, where N is a positive integer greater than or equal to 2;
[0013] The encoding end compresses the third target feature map through a compression prediction network to obtain a first bitstream; the third target feature map is a partial feature map of the N original feature maps;
[0014] The encoder determines a second bitstream based on the residual network, the N original feature maps, and the first bitstream;
[0015] The encoding end generates a target bitstream based on the first bitstream and the second bitstream.
[0016] According to a third aspect, an image processing apparatus is provided, comprising:
[0017] An acquisition module, configured to acquire a target code stream; the target code stream includes a first code stream and a second code stream;
[0018] A decoding module, configured to decode the first bitstream through a compression prediction network to obtain N reconstructed feature maps, and decode the second bitstream through a residual network to obtain N residual feature maps, wherein the N first feature maps correspond one-to-one to the N residual feature maps, and the residual feature maps are used to represent the residual between the corresponding reconstructed feature maps and the original feature maps. The loss function of the residual network is determined based on the loss generated by the visual detection task, and N is a positive integer greater than or equal to 2;
[0019] A determination module is used to determine N first target feature maps based on the N reconstructed feature maps and the N residual feature maps.
[0020] In a fourth aspect, an image processing apparatus is provided, comprising:
[0021] An acquisition module is used to obtain N original feature maps corresponding to the image, where N is a positive integer greater than or equal to 2;
[0022] A first encoding module is configured to compress a third target feature map through a compression prediction network to obtain a first bitstream; the third target feature map is a partial feature map of the N original feature maps;
[0023] A second encoding module, configured to determine a second bitstream based on the residual network, the N original feature maps, and the first bitstream;
[0024] A generating module is configured to generate a target code stream based on the first code stream and the second code stream.
[0025] In a fifth aspect, a terminal is provided, which includes a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method described in the first aspect are implemented, or the steps of the method described in the second aspect are implemented.
[0026] In a sixth aspect, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented, or the steps of the method described in the second aspect are implemented.
[0027] In the seventh aspect, a chip is provided, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the method described in the first aspect, or to implement the method described in the second aspect.
[0028] In an eighth aspect, a computer program / program product is provided, wherein the computer program / program product is stored in a storage medium, and the computer program / program product is executed by at least one processor to implement the steps of the method described in the first aspect, or to implement the steps of the method described in the second aspect.
[0029] In an embodiment of the present application, a target bitstream is obtained; N reconstructed feature maps are obtained by decoding the first bitstream using a compression prediction network, and N residual feature maps are obtained by decoding the second bitstream using a residual network; and N first target feature maps are determined based on the N reconstructed feature maps and the N residual feature maps. In an embodiment of the present application, N residual feature maps are obtained by decoding the second bitstream using a residual network. The loss function of the residual network is determined based on the loss generated by a subsequent visual inspection task. The N reconstructed feature maps are then padded with the N residual feature maps to determine N first target feature maps, thereby reducing distortion of the first target feature maps and improving the accuracy of the detection results of the subsequent visual inspection task. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] FIG1 is a flow chart of an image processing method according to an embodiment of the present invention;
[0031] FIG2 is a schematic diagram of the structure of a compression prediction network provided in an embodiment of the present application;
[0032] FIG3 is a schematic diagram of a structure of a residual network according to an embodiment of the present application;
[0033] FIG4 is a second structural diagram of a residual network provided in an embodiment of the present application;
[0034] FIG5 is a second flow chart of the image processing method provided in an embodiment of the present application;
[0035] FIG6 is a schematic diagram of an application flow of an image processing method provided in an embodiment of the present application;
[0036] FIG7 is a structural diagram of an image processing device according to an embodiment of the present application;
[0037] FIG8 is a second structural diagram of the image processing device provided in an embodiment of the present application;
[0038] FIG9 is a structural diagram of a communication device provided in an embodiment of the present application;
[0039] FIG10 is a schematic diagram of the hardware structure of the terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] The following will be combined with the accompanying drawings in the embodiments of this application to clearly describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.
[0041] The terms "first", "second", etc. in this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first" and "second" are generally of the same type, and do not limit the number of objects, for example, the first object can be one or more. In addition, "or" in this application represents at least one of the connected objects. For example, "A or B" covers three options, namely, Option 1: including A but not including B; Option 2: including B but not including A; Option 3: including both A and B. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0042] The term "indication" in this application can be either a direct indication (or explicit indication) or an indirect indication (or implicit indication). A direct indication can be understood as the sender explicitly informing the receiver of specific information, the operation to be performed, or the requested result, etc. in the instruction sent; an indirect indication can be understood as the receiver determining the corresponding information based on the instruction sent by the sender, or making a judgment and determining the operation to be performed or the requested result, etc. based on the judgment result.
[0043] The image processing device corresponding to the image processing method in the embodiment of the present application may be a terminal, which may also be referred to as a terminal device or a user terminal (UE). The terminal may be a mobile phone, a tablet computer (Tablet Personal Computer), a laptop computer (Laptop Computer), a notebook computer, a personal digital assistant (PDA), a handheld computer, a netbook, an ultra-mobile personal computer (UMPC), a mobile Internet device (MID), an augmented reality (AR), a virtual reality (VR) device, a robot, a wearable device (Wearable Device), an aircraft (flight vehicle), a vehicle user equipment (VUE), a shipborne device, a pedestrian user equipment (PUE), a smart home (home appliance with wireless communication function, such as a refrigerator, a television, a washing machine or furniture, etc.), a game console, a personal computer (PC), an ATM or a self-service machine, and other terminal-side devices. Wearable devices include: smart watches, smart bracelets, smart headphones, smart glasses, smart jewelry (smart bracelets, smart bracelets, smart rings, smart necklaces, smart anklets, smart anklets, etc.), smart wristbands, smart clothing, etc. Among them, vehicle-mounted devices can also be called vehicle-mounted terminals, vehicle-mounted controllers, vehicle-mounted modules, vehicle-mounted components, vehicle-mounted chips, or vehicle-mounted units, etc. It should be noted that the specific type of terminal is not limited in the embodiments of this application.
[0044] The present application provides an image processing method, which can be applied to a decoding end. The image processing method provided by the embodiments of the present application is described in detail below with reference to the accompanying drawings through some embodiments and their application scenarios.
[0045] Please refer to Figure 1, which is a flow chart of one of the image processing methods provided in an embodiment of the present application. The image processing method provided in this embodiment includes the following steps:
[0046] S101: The decoding end obtains the target bit stream.
[0047] In this step, the decoding end obtains the target code stream transmitted by the encoding end, and the above-mentioned target code stream includes a first code stream and a second code stream, wherein the first code stream is the encoding result of the reconstructed feature map, and the second code stream is the encoding result of the residual feature map.
[0048] S102: The decoding end decodes the first bit stream through a compression prediction network to obtain N reconstructed feature maps, and decodes the second bit stream through a residual network to obtain N residual feature maps.
[0049] In this step, the first bitstream can be decoded through the compression prediction network to obtain N reconstructed feature maps; the second bitstream can be decoded through the residual network to obtain N residual feature maps, wherein the N first feature maps correspond one-to-one to the N residual feature maps, and the residual feature maps are used to represent the residual between the corresponding reconstructed feature maps and the original feature maps. The loss function of the residual network is determined based on the loss generated by the visual detection task, and N is a positive integer greater than or equal to 2.
[0050] S103: The decoding end determines N first target feature maps based on the N reconstructed feature maps and the N residual feature maps.
[0051] In this step, the N reconstructed feature maps can be added to the corresponding N residual feature maps to obtain N first target feature maps. Optionally, the above steps can be performed in a residual network. In subsequent steps, visual detection of the image is performed based on the N first target feature maps.
[0052] Optionally, the above-mentioned visual detection task may be performing target detection on an image synthesized from N first target feature maps using a Fast Region-Convolutional Neural Network (Fast R-CNN).
[0053] In an embodiment of the present application, N residual feature maps are obtained by decoding the second code stream through a residual network. The loss function of the above-mentioned residual network is determined based on the loss generated by the subsequent visual detection task, and then the N reconstructed feature maps are respectively complemented by the N residual feature maps to determine N first target feature maps, thereby reducing the distortion of the first target feature map and improving the accuracy of the detection results of the subsequent visual detection task.
[0054] As a possible implementation, decoding the first code stream through a compression prediction network to obtain N reconstructed feature maps includes:
[0055] The decoding end performs arithmetic decoding and inverse quantization processing on the first bit stream to obtain a reconstructed first latent variable;
[0056] The decoding end decodes the reconstructed first latent variable through N first decoders included in a preset compression prediction network to obtain the N reconstructed feature maps; the N first decoders correspond one-to-one to the N reconstructed feature maps, and the scale of the reconstructed feature map output by each first decoder is different.
[0057] Please refer to Figure 2. As shown in Figure 2, the compression prediction network includes four first decoders, that is, the value of N is 4. After the first bitstream is arithmetically decoded and dequantized at the decoding end to obtain the reconstructed first latent variable (i.e., C1' in Figure 2), the reconstructed first latent variable is decoded by the four first decoders to obtain the corresponding four reconstructed feature maps. The latent variable can be understood as the variable obtained after compressing the feature map.
[0058] It should be noted that in the application scenario shown in Figure 2, the scales of the reconstructed feature maps output by the four first decoders in the compression prediction network are different, that is, the number of upsampling times corresponding to each first decoder is different. Since the sizes of the reconstructed feature map P5', the reconstructed feature map P4', the reconstructed feature map P3' and the reconstructed feature map P2' increase successively, the number of upsampling times of the first decoders corresponding to these four reconstructed feature maps increases successively.
[0059] As a possible implementation, the compression prediction network shown in FIG2 is a reversed single-input-multi-output (RSIMO) network.
[0060] As another possible implementation, decoding the first code stream through a compression prediction network to obtain N reconstructed feature maps includes:
[0061] The decoding end performs arithmetic decoding and inverse quantization processing on the first bit stream to obtain a reconstructed first latent variable;
[0062] The decoding end decodes the reconstructed first latent variable through a first decoder included in a preset compression prediction network to obtain M reconstructed feature maps;
[0063] The decoding end downsamples or upsamples one or more of the M reconstructed feature maps to obtain NM reconstructed feature maps, where M is an integer greater than or equal to 1 and less than N.
[0064] M reconstructed feature maps are obtained through a first decoder, and then upsampling or downsampling is performed according to one or more of the M reconstructed feature maps to obtain NM reconstructed feature maps, that is, N reconstructed feature maps are obtained.
[0065] Optionally, when M is 1, the M reconstructed feature maps are the feature maps with the smallest resolution among the N reconstructed feature maps. For example, when M is 1, a first decoder is used to decode the reconstructed first latent variable to obtain a reconstructed feature map P5', and then the reconstructed feature map P5' is upsampled to obtain a reconstructed feature map P2', a reconstructed feature map P3' and a reconstructed feature map P4'. The upsampling coefficients can be 8, 4 and 2 respectively, and the upsampling method can be bilinear interpolation (bilinear) or the like, which is not specifically limited in this application. The reconstructed feature map P5' is the feature map with the smallest resolution among the reconstructed feature map P2', the reconstructed feature map P3', the reconstructed feature map P4' and the reconstructed feature map P5'.
[0066] Optionally, when M is 2, the M reconstructed feature maps are the feature map with the smallest resolution and the feature map with the largest resolution among the N reconstructed feature maps. For example, when M is 2, a first decoder is used to decode the reconstructed first latent variable to obtain a reconstructed feature map P5' and a reconstructed feature map P2', and then the reconstructed feature map P5' is upsampled to obtain a reconstructed feature map P4', and the reconstructed feature map P2' is downsampled to obtain a reconstructed feature map P3'.
[0067] In the embodiment of the present application, higher video compression efficiency can be achieved through the above two possible implementation methods, especially the second method. The residual correlation of the reconstructed feature map obtained after upsampling or downsampling is high, so the compression efficiency of the subsequent residual network is also correspondingly high.
[0068] Optionally, the second code stream is an encoding result of the N residual feature maps, and the residual network includes one decoder;
[0069] The step of decoding the second code stream through a residual network to obtain N residual feature maps includes:
[0070] The decoding end performs arithmetic decoding on the second code stream to obtain a reconstructed second latent variable;
[0071] The decoding end decodes the reconstructed second latent variable through a decoder included in the residual network to obtain the N residual feature maps.
[0072] Optionally, the residual network includes a decoder, and the second bitstream is the encoding result of N residual feature maps. Please refer to Figure 3. As shown in Figure 3, the residual network includes a decoder. After arithmetically decoding the second bitstream at the decoding end to obtain the reconstructed second latent variable (i.e., C2' in Figure 3), the decoder decodes the reconstructed second latent variable to obtain four residual feature maps, and adds the four residual feature maps to the four reconstructed feature maps P2' to P5' to obtain the first target feature map.
[0073] The size of the feature map input to the encoder in the residual network is the same as the size of the feature map output by the decoder in the residual network. This residual network can generalize multi-layer features to reduce the number of parameters in the residual network.
[0074] It should be noted that, in the residual network, the step of adding N residual feature maps to the corresponding reconstructed feature maps to obtain N first target feature maps can also be performed.
[0075] Optionally, the second bitstream is an encoding result of a second target feature map, the second target feature map is a partial feature map of the N residual feature maps, the residual network includes N second decoders, and the scale of the residual feature map output by each second decoder is different;
[0076] The step of decoding the second code stream through a residual network to obtain N residual feature maps includes:
[0077] The decoding end performs arithmetic decoding on the second code stream to obtain a reconstructed second latent variable;
[0078] The decoding end decodes the reconstructed second latent variable through N second decoders included in the residual network to obtain the N residual feature maps.
[0079] Optionally, the residual network includes N second decoders, the second bitstream is the encoding result of the second target feature map, and the second target feature map is a partial feature map of the N residual feature maps. Optionally, the second target feature map is a feature map with the highest resolution among the N residual feature maps, or the second target feature map is a feature map with the second highest resolution among the N residual feature maps.
[0080] Please refer to Figure 4. As shown in Figure 4, the residual network includes four second decoders. After performing arithmetic decoding on the second bitstream at the decoding end to obtain the reconstructed second latent variable (i.e., C2' in Figure 4), the reconstructed second latent variable is decoded by the four second decoders to obtain four residual feature maps. The four residual feature maps are added to the reconstructed feature maps P2' to P5' to obtain four first target feature maps.
[0081] It should be noted that in the residual network shown in FIG4 , the scales of the residual feature maps output by the four second decoders are different, that is, the number of downsampling times corresponding to each second decoder is different.
[0082] In this embodiment, the second decoder in the residual network only needs to decode some of the N residual feature maps, thereby reducing the workload of the decoder and improving decoding efficiency.
[0083] As a possible implementation, the residual network shown in FIG4 is a single-input-multi-output (SIMO) network.
[0084] Optionally, the loss function of the compression prediction network is determined based on a weighted sum of a first rate loss function and N distortion loss functions.
[0085] When N is 4, that is, when the first bitstream is decoded by the compression prediction network to obtain the reconstructed feature map P2', the reconstructed feature map P3', the reconstructed feature map P4' and the reconstructed feature map P5', the loss function of the compression prediction network can be determined by the following formula (1): MSE = λ1·(D2+D3+D4+D5)+ R1 (1)
[0086] Among them, D2 represents the distortion loss function associated with the reconstruction feature map P2', D3 represents the distortion loss function associated with the reconstruction feature map P3', D4 represents the distortion loss function associated with the reconstruction feature map P4', D5 represents the distortion loss function associated with the reconstruction feature map P5', R1 represents the first rate loss function, λ1 is the weight parameter used to balance the feature map distortion and the encoding and decoding rate, L MSE Represents the loss function of the compressed prediction network.
[0087] Optionally, the N distortion loss functions correspond one-to-one to the N reconstructed feature maps, and the distortion loss function is determined based on the loss between the corresponding reconstructed feature map and the original feature map; the first rate loss function is determined based on edge information and the reconstructed first latent variable.
[0088] When N is 4, that is, when the first code stream is decoded by the compression prediction network to obtain the reconstructed feature map P2', the reconstructed feature map P3', the reconstructed feature map P4' and the reconstructed feature map P5', the distortion loss function associated with each feature map can be determined by the following formula:
[0089] Among them, D2 represents the distortion loss function associated with the reconstructed feature map P2', D3 represents the distortion loss function associated with the reconstructed feature map P3', D4 represents the distortion loss function associated with the reconstructed feature map P4', D5 represents the distortion loss function associated with the reconstructed feature map P5', the l2 parameter is used to represent the loss between the original feature map and the reconstructed feature map, and N is the number of training samples.
[0090] Alternatively, the first rate loss function may be determined by the following formula (2):
[0091] Where R1 represents the first rate loss function, N is the number of training samples, For edge information, is the first latent variable for reconstruction, Indicates The first latent variable reconstructed under the condition The probability distribution of pixel values, Representing edge information The image is divided into edges, corners, and regions. Edge information is the information on the edge of the image. Edge information is one of the important features in depth images and can be used for tasks such as target detection, scene segmentation, and object tracking.
[0092] Optionally, the loss function of the residual network is determined based on a weighted sum of a second rate loss function and a task loss function.
[0093] Alternatively, the loss function of the residual network can be determined by the following formula (3): Task =λ2·T+R2 (3)
[0094] Among them, L Task Represents the loss function of the residual network, λ2 is the weight parameter used to balance the loss of the visual detection task and the encoding and decoding rate, R2 represents the second rate loss function, and T represents the task loss function.
[0095] Optionally, the task loss function is determined based on the loss generated by visual detection of the N reconstructed feature maps, and the second rate loss function is determined based on edge information and a reconstructed second latent variable.
[0096] Alternatively, the task loss function can be expressed by the following formula (4): T = L cls +L box +L mask (4)
[0097] Among them, T represents the task loss function, L cls Represents the classification value of the bounding box in the visual detection task, L box Represents the regression loss value of the bounding box in the visual detection task, L mask Represents the loss value of the mask part in the visual detection task.
[0098] Alternatively, the second rate loss function may be determined by the following formula (5):
[0099] Where R2 represents the first rate loss function, N is the number of training samples, For edge information, is the second latent variable for reconstruction, Indicates The second latent variable reconstructed under the condition The probability distribution of pixel values, Representing edge information The probability distribution of .
[0100] Optionally, the network structure of the compression prediction network can be selected and designed according to actual needs. For example, the network structure of the compression prediction network is a Balle network structure or a Cheng network structure.
[0101] Optionally, the network structure of the residual network can be the same as the network structure of the compression prediction network, or can be selected and designed according to actual needs. For example, the network structure of the residual network is a Balle network structure or a Cheng network structure.
[0102] The training process of the above-mentioned compression prediction network can be as follows: inputting training samples into the compression prediction network to obtain the latent variables and reconstructed feature maps output by the compression prediction network. The rate loss function is adjusted according to the latent variables, the number of training samples, and the edge information. The distortion loss function is adjusted according to the number of samples and the loss between the original feature map and the reconstructed feature map. The compression prediction network is then adjusted based on the above-mentioned rate loss function and distortion loss function. When the loss function value represented by the loss function of the compression prediction network is less than or equal to a preset threshold, the compression prediction network training is determined to be completed.
[0103] The training process of the aforementioned network may include freezing the network parameters of the compressed prediction network after training of the compressed prediction network is completed, and then iteratively training the residual network. During the iterative training of the residual network, the output of the residual network, i.e., the first target feature map, may be input into the visual inspection network for evaluation of the visual inspection task, and the residual network may be iteratively optimized based on the task loss function.
[0104] It should be understood that the loss function of the residual network can randomly train single-layer features during each iterative training, thereby increasing the training speed of the residual network and improving the performance of subsequent visual inspection tasks.
[0105] It should be understood that after the compression prediction network training is completed, the network parameters in the compression prediction network are frozen, and then the residual network is iteratively trained to achieve segmented training of the compression prediction network and the residual network, avoiding the correlation between the two networks during the iterative training process, thereby improving the performance of the encoding and decoding ends.
[0106] Please refer to Figure 5, which is a second flow chart of the image processing method provided in the embodiment of the present application. The image processing method provided in this embodiment includes the following steps:
[0107] S501: The encoder obtains N original feature maps corresponding to the image.
[0108] In this step, the encoder obtains N original feature maps, where N is a positive integer greater than or equal to 2.
[0109] In an optional embodiment, the N original feature maps may be obtained by performing a feature map extraction operation on the image. Specifically, four original feature maps corresponding to the image may be extracted using Feature Pyramid Networks (FPN).
[0110] In other optional embodiments, multiple original feature maps corresponding to the image can also be extracted through a convolutional neural network. The specific implementation method of obtaining N original feature maps corresponding to the image is not limited here.
[0111] The resolution of each original feature map is different, or the image features contained in each original feature map are different.
[0112] S502: The encoding end compresses the third target feature map through a compression prediction network to obtain a first bit stream.
[0113] In this step, some of the N original feature maps can be determined as third target feature maps, and the third target feature maps are compressed by the compression prediction network to obtain the first bitstream. For specific implementation methods, please refer to the subsequent embodiments.
[0114] S503: The encoder determines a second bitstream based on the residual network, the N original feature maps, and the first bitstream.
[0115] In this step, the second bitstream can be determined based on the residual network, the N original feature maps, and the first bitstream. For specific implementation methods, please refer to the subsequent embodiments.
[0116] S504: The encoding end generates a target bitstream based on the first bitstream and the second bitstream.
[0117] In this step, after obtaining the first code stream and the second code stream, the encoder can mix the first code stream and the second code stream to generate a target code stream.
[0118] In this embodiment, compared with the method in the related art of compressing all the original feature maps corresponding to the image to obtain the target code stream, the embodiment of the present application only needs to compress part of the original feature maps to obtain the target code stream, thereby reducing the bit rate of the encoded code stream.
[0119] Optionally, compressing the third target feature map through a compression prediction network to obtain a first bitstream includes:
[0120] The encoder performs downsampling processing on the third target feature map through a compression prediction network;
[0121] The encoder end compresses the third target feature map after downsampling through the compression prediction network, obtaining a first latent variable corresponding to the third target feature map;
[0122] The encoding end quantizes the first latent variable and performs arithmetic coding on the quantized first latent variable to obtain the first code stream.
[0123] Optionally, the original feature map with the lowest resolution among the N original feature maps may be determined as the third target feature map.
[0124] Specifically, in the implementation scenario of extracting four original feature maps corresponding to an image through Feature Pyramid Networks (FPN), please refer to Table 1:
[0125] Table 1:
[0126] From Table 1, we can see that the average precision corresponding to the original feature maps P4 and P5 with smaller sizes (i.e., lower resolution) is lower, which means that the original feature maps P4 and P5 have a greater impact on the performance of subsequent visual detection tasks.
[0127] Optionally, the original feature map with the lowest resolution can be determined as the third target feature map, the compression prediction network compresses the third target feature map, and in subsequent steps, N reconstructed feature maps are predicted based on the compression results of the third target feature map. For the encoding end, only the third target feature map needs to be compressed to obtain the first code stream, thereby saving the code rate for compressing other original feature maps with larger resolutions.
[0128] In other implementations, one original feature map may be randomly selected from two original feature maps with lower resolutions and determined as the third target feature map.
[0129] Specifically, the above compression process is as follows: the encoding end downsamples the third target feature map through the compression prediction network to obtain the first latent variable, quantizes the above first latent variable, and arithmetically encodes the quantized first latent variable to obtain the first code stream.
[0130] For ease of understanding, please refer to FIG2 , where P5 in FIG2 represents the third target feature map, and C1 represents the first latent variable.
[0131] Optionally, determining the second bitstream according to the residual network, the N original feature maps, and the first bitstream includes:
[0132] The encoder decodes the first bitstream through a compression prediction network to obtain N reconstructed feature maps, where the N reconstructed feature maps correspond one-to-one to the N original feature maps;
[0133] The encoding end obtains N residual feature maps according to the N original feature maps and the N reconstructed feature maps;
[0134] The encoding end encodes the N residual feature maps through a residual network to obtain the second code stream.
[0135] In this embodiment, after obtaining the first bitstream, the compression prediction network can decode the first bitstream to obtain N reconstructed feature maps. As described above, the N reconstructed feature maps correspond one-to-one to the N original feature maps. The N original feature maps are then subtracted from the corresponding N reconstructed feature maps to obtain N residual feature maps. As described above, the residual feature maps are used to represent the residual between the corresponding reconstructed feature maps and the original feature maps.
[0136] Specifically, as shown in FIG3 , the residual feature map is encoded by the encoder of the residual network to obtain a second latent variable, namely C2 in FIG3 , and the first latent variable is arithmetically encoded to obtain a second code stream.
[0137] Optionally, determining the second bitstream according to the residual network, the N original feature maps, and the first bitstream includes:
[0138] The encoder decodes the first bitstream through a compression prediction network to obtain N reconstructed feature maps, where the N reconstructed feature maps correspond one-to-one to the N original feature maps;
[0139] The encoding end obtains N residual feature maps according to the N original feature maps and the N reconstructed feature maps;
[0140] The encoding end encodes the second target feature map through a residual network to obtain the second code stream, where the second target feature map is a partial feature map of the N residual feature maps.
[0141] In this embodiment, after obtaining N residual feature maps, the feature map with the highest resolution among the N residual feature maps is determined as the second target feature map, and the above second target feature map is encoded by the encoder of the residual network to obtain a second code stream.
[0142] In this embodiment, the encoder in the residual network only needs to encode some of the N residual feature maps to generate a second bit stream, thereby reducing the bit rate of the second bit stream.
[0143] For example, in the application scenario shown in Figure 4, the residual feature map obtained by subtracting the original feature map P2 from the reconstructed feature map P2' is determined as the second target feature map, and the above-mentioned second target feature map is encoded by the encoder of the residual network shown in Figure 4 to obtain a second code stream.
[0144] To facilitate understanding of the overall technical solution, please refer to Figure 6. In the application scenario shown in Figure 6, the original feature map P5 is transmitted to the compression prediction network to obtain reconstructed feature maps P2' to P5', and the original feature maps P2 to P5 are subtracted from the reconstructed feature maps P2' to P5' to obtain residual feature maps. The above residual feature maps are input into the prediction network, and the reconstructed feature maps P2' to P5' are added to the output of the residual network to obtain the first target feature map.
[0145] The image processing method provided in the embodiment of the present application can be executed by an image processing device. In the embodiment of the present application, the image processing device provided in the embodiment of the present application is described by taking the image processing device executing the image processing method as an example.
[0146] As shown in FIG7 , the embodiment of the present application further provides an image processing device 700, including:
[0147] An acquisition module 701 is configured to acquire a target bitstream, wherein the target bitstream includes a first bitstream and a second bitstream.
[0148] A decoding module 702 is configured to decode the first bitstream using a compression prediction network to obtain N reconstructed feature maps, and decode the second bitstream using a residual network to obtain N residual feature maps, wherein the N first feature maps correspond one-to-one to the N residual feature maps, and the residual feature maps are used to represent the residual between the corresponding reconstructed feature maps and the original feature maps. The loss function of the residual network is determined based on the loss generated by the visual detection task, and N is a positive integer greater than or equal to 2;
[0149] The determination module 703 is configured to determine N first target feature maps based on the N reconstructed feature maps and the N residual feature maps.
[0150] Optionally, the decoding module 702 is configured to decode the first code stream through a compression prediction network to obtain N reconstructed feature maps, including:
[0151] The decoding module 702 is used to perform arithmetic decoding and inverse quantization on the first code stream to obtain a reconstructed first latent variable; the reconstructed first latent variable is decoded by the N first decoders included in the preset compression prediction network to obtain the N reconstructed feature maps; the N first decoders correspond one-to-one to the N reconstructed feature maps, and the scale of the reconstructed feature map output by each first decoder is different.
[0152] Optionally, the decoding module 702 is configured to decode the first code stream through a compression prediction network to obtain N reconstructed feature maps, including:
[0153] The decoding module 702 is used to perform arithmetic decoding and inverse quantization on the first code stream to obtain a reconstructed first latent variable; decode the reconstructed first latent variable through a first decoder included in a preset compression prediction network to obtain M reconstructed feature maps; downsample or upsample one or more of the M reconstructed feature maps to obtain NM reconstructed feature maps, where M is an integer greater than or equal to 1 and less than N.
[0154] Optionally, the second code stream is an encoding result of the N residual feature maps, and the residual network includes one decoder;
[0155] The decoding module 702 is configured to decode the second bitstream using a residual network to obtain N residual feature maps, including:
[0156] The decoding module 702 is configured to perform arithmetic decoding on the second bitstream to obtain a reconstructed second latent variable;
[0157] The reconstructed second latent variable is decoded by a decoder included in the residual network to obtain the N residual feature maps.
[0158] Optionally, the second bitstream is an encoding result of a second target feature map, the second target feature map is a partial feature map of the N residual feature maps, the residual network includes N second decoders, and the scale of the residual feature map output by each second decoder is different;
[0159] The decoding module 702 is configured to decode the second bitstream through a residual network to obtain N residual feature maps, including:
[0160] The decoding module 702 performs arithmetic decoding on the second code stream to obtain a reconstructed second latent variable; and decodes the reconstructed second latent variable through the N second decoders included in the residual network to obtain the N residual feature maps.
[0161] Optionally, the loss function of the compression prediction network is determined based on a weighted sum of a first rate loss function and N distortion loss functions.
[0162] Optionally, the N distortion loss functions correspond one-to-one to the N reconstructed feature maps, and the distortion loss function is determined based on the loss between the corresponding reconstructed feature map and the original feature map; the first rate loss function is determined based on edge information and the reconstructed first latent variable.
[0163] Optionally, the loss function of the residual network is determined based on a weighted sum of a second rate loss function and a task loss function.
[0164] Optionally, the task loss function is determined based on the loss generated by visual detection of the N reconstructed feature maps, and the second rate loss function is determined based on edge information and a reconstructed second latent variable.
[0165] In an embodiment of the present application, N residual feature maps are obtained by decoding the second code stream through a residual network. The loss function of the above-mentioned residual network is determined based on the loss generated by the subsequent visual detection task, and then the N reconstructed feature maps are respectively complemented by the N residual feature maps to determine N first target feature maps, thereby reducing the distortion of the first target feature map and improving the accuracy of the detection results of the subsequent visual detection task.
[0166] This device embodiment corresponds to the image processing method embodiment shown in FIG1 . All implementation processes and implementation methods on the decoding end in the above method embodiment are applicable to this device embodiment and can achieve the same technical effects.
[0167] The image processing method provided in the embodiment of the present application can be executed by an image processing device. In the embodiment of the present application, the image processing device provided in the embodiment of the present application is described by taking the image processing device executing the image processing method as an example.
[0168] As shown in FIG8 , the embodiment of the present application further provides an image processing apparatus 800, including:
[0169] An acquisition module 801 is configured to acquire N original feature maps corresponding to an image, where N is a positive integer greater than or equal to 2.
[0170] A first encoding module 802 is configured to compress a third target feature map through a compression prediction network to obtain a first bitstream; the third target feature map is a partial feature map of the N original feature maps;
[0171] A second encoding module 803 is configured to determine a second bitstream based on the residual network, the N original feature maps, and the first bitstream;
[0172] The generating module 804 is configured to generate a target bitstream based on the first bitstream and the second bitstream.
[0173] Optionally, the first encoding module 802 is specifically configured to:
[0174] Downsampling the third target feature map through a compression prediction network;
[0175] Obtaining a first latent variable corresponding to the third target feature map by compressing and downsampling the third target feature map through the compression prediction network;
[0176] The first latent variable is quantized, and arithmetic coding is performed on the quantized first latent variable to obtain the first code stream.
[0177] Optionally, the second encoding module 803 is specifically configured to:
[0178] Decoding the first bitstream through a compression prediction network to obtain N reconstructed feature maps, where the N reconstructed feature maps correspond one-to-one to the N original feature maps;
[0179] Obtaining N residual feature maps according to the N original feature maps and the N reconstructed feature maps;
[0180] The N residual feature maps are encoded through a residual network to obtain the second code stream.
[0181] Optionally, the second encoding module 803 is further specifically configured to:
[0182] Decoding the first bitstream through a compression prediction network to obtain N reconstructed feature maps, where the N reconstructed feature maps correspond one-to-one to the N original feature maps;
[0183] Obtaining N residual feature maps according to the N original feature maps and the N reconstructed feature maps;
[0184] The second target feature map is encoded through the residual network to obtain the second code stream, where the second target feature map is a partial feature map of the N residual feature maps.
[0185] In this embodiment, compared with the method in the related art of compressing all the original feature maps corresponding to the image to obtain the target code stream, the embodiment of the present application only needs to compress part of the original feature maps to obtain the target code stream, thereby reducing the bit rate of the encoded code stream.
[0186] The image processing device provided in the embodiment of the present application can implement each process implemented in the method embodiment of Figure 5 and achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0187] The image processing device in the embodiments of the present application can be an electronic device, such as an electronic device with an operating system, or a component in an electronic device, such as an integrated circuit or chip. The electronic device can be a terminal, or it can be other devices other than a terminal. For example, the terminal can include but is not limited to the types of terminals listed above, and other devices can be servers, network attached storage (NAS), etc., which are not specifically limited in the embodiments of the present application.
[0188] The image processing device provided in the embodiment of the present application can implement the various processes implemented by the method embodiment of Figure 1, or can implement the various processes implemented by the method embodiment of Figure 5, and achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0189] Optionally, as shown in Figure 9, an embodiment of the present application also provides a communication device 900, including a processor 901 and a memory 902, and the memory 902 stores programs or instructions that can be run on the processor 901. For example, when the communication device 900 is a terminal, the program or instructions are executed by the processor 901 to implement the various steps of the above-mentioned image processing method embodiment and can achieve the same technical effect.
[0190] The present application also provides a terminal including a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is configured to execute a program or instruction to implement the steps of the method embodiment shown in FIG1 , or to implement the steps of the method embodiment shown in FIG5 . This terminal embodiment corresponds to the above-mentioned terminal-side method embodiment, and each implementation process and implementation method of the above-mentioned method embodiment can be applied to this terminal embodiment and can achieve the same technical effect. Specifically, FIG10 is a schematic diagram of the hardware structure of a terminal implementing an embodiment of the present application.
[0191] The terminal 1000 includes but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010.
[0192] Those skilled in the art will appreciate that the terminal 1000 may also include a power supply (such as a battery) to power various components. The power supply may be logically connected to the processor 1010 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The terminal structure shown in FIG10 does not limit the terminal. The terminal may include more or fewer components than shown, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0193] It should be understood that in an embodiment of the present application, the input unit 1004 may include a graphics processing unit (GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and an operating stick, which will not be repeated here.
[0194] In the embodiment of the present application, after receiving downlink data from a network-side device, the RF unit 1001 may transmit the data to the processor 1010 for processing; the RF unit 1001 may also send uplink data to the network-side device. Typically, the RF unit 1001 includes, but is not limited to, an antenna, an amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, and the like.
[0195] The memory 1009 can be used to store software programs or instructions and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 1009 may include a volatile memory or a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM), and a direct memory bus random access memory (DRRAM). The memory 1009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0196] Processor 1010 may include one or more processing units. Optionally, processor 1010 integrates an application processor and a modem processor. The application processor primarily handles operations related to the operating system, user interface, and application programs, while the modem processor primarily processes wireless communication signals, such as a baseband processor. It is understood that the modem processor may not be integrated into processor 1010.
[0197] The processor 1001 is configured to perform the following operations:
[0198] Get the target stream;
[0199] Decoding the first bitstream through a compression prediction network to obtain N reconstructed feature maps, and decoding the second bitstream through a residual network to obtain N residual feature maps;
[0200] Determine N first target feature maps based on the N reconstructed feature maps and the N residual feature maps.
[0201] Alternatively, the processor 1001 is further configured to perform the following operations:
[0202] Get N original feature maps corresponding to the image;
[0203] Compressing the third target feature map through a compression prediction network to obtain a first bitstream;
[0204] Determine a second bitstream according to the residual network, the N original feature maps, and the first bitstream;
[0205] A target code stream is generated based on the first code stream and the second code stream.
[0206] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned image processing method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0207] The processor is the processor in the terminal described in the above embodiment. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. In some examples, the readable storage medium may be a non-transitory readable storage medium.
[0208] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned image processing method embodiment and achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0209] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0210] An embodiment of the present application further provides a computer program / program product, which is stored in a storage medium. The computer program / program product is executed by at least one processor to implement the various processes of the above-mentioned image processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0211] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0212] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of a computer software product plus a necessary general-purpose hardware platform, or of course, by hardware. The computer software product is stored in a storage medium (such as ROM, RAM, magnetic disk, optical disk, etc.) and includes a number of instructions for enabling a terminal or network-side device to execute the methods described in each embodiment of the present application.
[0213] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms of implementation methods without departing from the purpose of this application and the scope of protection of the claims. These implementation methods are all within the protection of this application.
Claims
1. An image processing method, comprising: The decoding end obtains a target code stream; the target code stream includes a first code stream and a second code stream; The decoding end decodes the first bitstream through a compression prediction network to obtain N reconstructed feature maps, and decodes the second bitstream through a residual network to obtain N residual feature maps, wherein the N first feature maps correspond to the N residual feature maps one by one, and the residual feature maps are used to characterize the residual between the corresponding reconstructed feature maps and the original feature maps, and the loss function of the residual network is determined based on the loss generated by the visual detection task, and N is a positive integer greater than or equal to 2; The decoding end determines N first target feature maps based on the N reconstructed feature maps and the N residual feature maps.
2. The method according to claim 1, wherein: The step of decoding the first bitstream through a compression prediction network to obtain N reconstructed feature maps includes: The decoding end performs arithmetic decoding and inverse quantization processing on the first bit stream to obtain a reconstructed first latent variable; The decoding end decodes the reconstructed first latent variable through N first decoders included in a preset compression prediction network to obtain the N reconstructed feature maps; the N first decoders correspond one-to-one to the N reconstructed feature maps, and the scale of the reconstructed feature map output by each first decoder is different.
3. The method according to claim 1, wherein: The step of decoding the first bitstream through a compression prediction network to obtain N reconstructed feature maps includes: The decoding end performs arithmetic decoding and inverse quantization processing on the first bit stream to obtain a reconstructed first latent variable; The decoding end decodes the reconstructed first latent variable through a first decoder included in a preset compression prediction network to obtain M reconstructed feature maps; The decoding end downsamples or upsamples one or more of the M reconstructed feature maps to obtain NM reconstructed feature maps, where M is an integer greater than or equal to 1 and less than N.
4. The method according to any one of claims 1 to 3, wherein: The second bitstream is the encoding result of the N residual feature maps, and the residual network includes a decoder; The step of decoding the second bitstream through a residual network to obtain N residual feature maps includes: The decoding end performs arithmetic decoding on the second code stream to obtain a reconstructed second latent variable; The decoding end decodes the reconstructed second latent variable through a decoder included in the residual network to obtain the N residual feature maps.
5. The method according to any one of claims 1 to 3, wherein: The second bitstream is an encoding result of a second target feature map, the second target feature map is a partial feature map of the N residual feature maps, the residual network includes N second decoders, and the scale of the residual feature map output by each second decoder is different; The step of decoding the second bitstream through a residual network to obtain N residual feature maps includes: The decoding end performs arithmetic decoding on the second code stream to obtain a reconstructed second latent variable; The decoding end decodes the reconstructed second latent variable through N second decoders included in the residual network to obtain the N residual feature maps.
6. The method according to any one of claims 1 to 5, wherein: The loss function of the compression prediction network is determined based on a weighted sum of a first rate loss function and N distortion loss functions.
7. The method according to claim 6, wherein: The N distortion loss functions correspond one-to-one to the N reconstructed feature maps, and the distortion loss function is determined based on the loss between the corresponding reconstructed feature map and the original feature map; the first rate loss function is determined based on edge information and the reconstructed first latent variable.
8. The method according to any one of claims 1 to 5, wherein: The loss function of the residual network is determined based on a weighted sum of a second rate loss function and a task loss function.
9. The method according to claim 8, wherein: The task loss function is determined according to the loss generated by visual detection of the N reconstructed feature maps, and the second rate loss function is determined based on edge information and a reconstructed second latent variable.
10. An image processing method, comprising: The encoder obtains N original feature maps corresponding to the image, where N is a positive integer greater than or equal to 2; The encoding end compresses the third target feature map through a compression prediction network to obtain a first bit stream; The third target feature map is a partial feature map of the N original feature maps; The encoding end determines a second bitstream according to the residual network, the N original feature maps and the first bitstream; The encoding end generates a target bitstream based on the first bitstream and the second bitstream.
11. The method according to claim 10, wherein: The compressing the third target feature map through the compression prediction network to obtain the first bitstream includes: The encoding end performs downsampling processing on the third target feature map through a compression prediction network; The encoder end compresses the third target feature map after downsampling through the compression prediction network to obtain a first latent variable corresponding to the third target feature map; The encoding end quantizes the first latent variable, and performs arithmetic encoding on the quantized first latent variable to obtain the first code stream.
12. The method according to claim 10 or 11, wherein: The determining the second bitstream according to the residual network, the N original feature maps and the first bitstream includes: The encoder decodes the first bitstream through a compression prediction network to obtain N reconstructed feature maps, where the N reconstructed feature maps correspond one-to-one to the N original feature maps; The encoding end obtains N residual feature maps according to the N original feature maps and the N reconstructed feature maps; The encoding end encodes the N residual feature maps through a residual network to obtain the second code stream.
13. The method according to claim 10 or 11, wherein: The determining the second bitstream according to the residual network, the N original feature maps and the first bitstream includes: The encoder decodes the first bitstream through a compression prediction network to obtain N reconstructed feature maps, where the N reconstructed feature maps correspond one-to-one to the N original feature maps; The encoding end obtains N residual feature maps according to the N original feature maps and the N reconstructed feature maps; The encoding end encodes the second target feature map through a residual network to obtain the second bitstream, where the second target feature map is a partial feature map of the N residual feature maps.
14. An image processing device, comprising: An acquisition module, used for acquiring a target code stream; the target code stream includes a first code stream and a second code stream; A decoding module, configured to decode the first code stream through a compression prediction network to obtain N reconstructed feature maps, and decode the second code stream through a residual network to obtain N residual feature maps, wherein the N first feature maps correspond to the N residual feature maps one by one, and the residual feature maps are used to characterize the residual between the corresponding reconstructed feature maps and the original feature maps, and the loss function of the residual network is determined based on the loss generated by the visual detection task, and N is a positive integer greater than or equal to 2; A determination module is used to determine N first target feature maps based on the N reconstructed feature maps and the N residual feature maps.
15. The device according to claim 14, wherein: The decoding module is used to decode the first code stream through a compression prediction network to obtain N reconstructed feature maps, including: The decoding module is used to perform arithmetic decoding and inverse quantization processing on the first code stream to obtain a reconstructed first latent variable; the reconstructed first latent variable is decoded by N first decoders included in a preset compression prediction network to obtain the N reconstructed feature maps; the N first decoders correspond to the N reconstructed feature maps one by one, and the scale of the reconstructed feature map output by each first decoder is different.
16. The device according to claim 14, wherein: The decoding module is used to decode the first code stream through a compression prediction network to obtain N reconstructed feature maps, including: The decoding module is used to perform arithmetic decoding and inverse quantization processing on the first code stream to obtain a reconstructed first latent variable; decode the reconstructed first latent variable through a first decoder included in a preset compression prediction network to obtain M reconstructed feature maps; downsample or upsample one or more of the M reconstructed feature maps to obtain NM reconstructed feature maps, where M is an integer greater than or equal to 1 and less than N.
17. The device according to any one of claims 14 to 16, wherein: The second bitstream is the encoding result of the N residual feature maps, and the residual network includes a decoder; The decoding module is used to decode the second code stream through a residual network to obtain N residual feature maps, including: The decoding module is used to perform arithmetical decoding on the second code stream to obtain a reconstructed second latent variable; and decode the reconstructed second latent variable through a decoder included in the residual network to obtain the N residual feature maps.
18. The device according to any one of claims 14 to 16, wherein: The second bitstream is an encoding result of a second target feature map, the second target feature map is a partial feature map of the N residual feature maps, the residual network includes N second decoders, and the scale of the residual feature map output by each second decoder is different; The decoding module is used to decode the second code stream through a residual network to obtain N residual feature maps, including: The decoding module is used to perform arithmetic decoding on the second code stream to obtain a reconstructed second latent variable; The reconstructed second latent variable is decoded by N second decoders included in the residual network to obtain the N residual feature maps.
19. The device according to any one of claims 14 to 18, wherein: The loss function of the compression prediction network is determined based on a weighted sum of a first rate loss function and N distortion loss functions.
20. The device according to any one of claims 14 to 18, wherein: The loss function of the residual network is determined based on a weighted sum of a second rate loss function and a task loss function.
21. An image processing device, comprising: An acquisition module is used to acquire N original feature maps corresponding to the image, where N is a positive integer greater than or equal to 2; A first encoding module, used for compressing the third target feature map through a compression prediction network to obtain a first code stream; The third target feature map is a partial feature map of the N original feature maps; A second encoding module, configured to determine a second bitstream according to the residual network, the N original feature maps and the first bitstream; A generating module is used to generate a target code stream based on the first code stream and the second code stream.
22. The device according to claim 21, wherein The first encoding module is specifically used for: Downsampling the third target feature map by using a compression prediction network; Obtaining a first latent variable corresponding to the third target feature map by compressing the third target feature map after downsampling processing through the compression prediction network; The first latent variable is quantized, and the quantized first latent variable is arithmetically encoded to obtain the first code stream.
23. The device according to claim 21 or 22, wherein: The second encoding module is specifically used for: Decoding the first bitstream through a compression prediction network to obtain N reconstructed feature maps, wherein the N reconstructed feature maps correspond one-to-one to the N original feature maps; Obtaining N residual feature maps according to the N original feature maps and the N reconstructed feature maps; The N residual feature maps are encoded through a residual network to obtain the second code stream.
24. The device according to claim 21 or 22, wherein: The second encoding module is further specifically used for: Decoding the first bitstream through a compression prediction network to obtain N reconstructed feature maps, wherein the N reconstructed feature maps correspond one-to-one to the N original feature maps; Obtaining N residual feature maps according to the N original feature maps and the N reconstructed feature maps; The second target feature map is encoded through a residual network to obtain the second code stream, where the second target feature map is a partial feature map of the N residual feature maps.
25. A terminal comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the image processing method as described in any one of claims 1 to 9 are implemented, or the steps of the image processing method as described in any one of claims 10 to 13 are implemented.
26. A readable storage medium storing a program or instruction, wherein the program or instruction, when executed by a processor, implements the steps of the image processing method as described in any one of claims 1 to 9, or implements the steps of the image processing method as described in any one of claims 10 to 13.
Citation Information
Patent Citations
Image processing method fusing different visual tasks, electronic equipment and medium
CN111898638A
Image reconstruction processing method and device, electronic equipment and storage medium
CN113628115A
Variable code rate video compression method, system and device and storage medium
CN114501013A
Method, apparatus, system and computer-readable recording medium for feature information
US20220092827A1
