# Research on Spaceborne Target Detection Based on Yolov5 and Image Compression
## 4 Image Compression  
The basic structure of JPEG2000 compression is shown in Figure 9. First, the original image data are preprocessed, and then the results are transformed by a discrete wavelet. Before the formation of the output bit stream, the transformation coefficient should be  
Figure 8: An example of the image segmentation detection method. Figure 7: The modification of our proposed Yolov5 network for satellite image detection. quantized and the embedded block should be coded using EBCOT with optimized truncation. The decoder uses the inverse process of the encoder. After the compressed image data flow is stored or transmitted, the data stream is first unpacked and the entropy decoded, and then the reverse quantization and inverse wavelet transform are carried out [19]. The result of the reverse transform is processed and synthesized in the post process to obtain the reconstructed image data. The general steps of the JPEG2000 coding process are as follows:  
1. The original image is decomposed into each color component. As there is a certain correlation between components, the redundancy between data can be reduced and the compression efficiency can be improved by decomposing the related components. 2. The image and each component image are decomposed into rectangular image slices, which are the basic processing units of the original image and the reconstructed image. 3. Wavelet transform is applied to each image slice to generate multi-level coefficient images, which can be reconstructed into images with different resolutions. 4. The decomposed wavelet coefficients are quantized to form the code block of the rectangular array. 5. Entropy coding is carried out for the coefficient bit plane in the code block. 6. The region of interest can be encoded at a higher quality compared with the image background region. 7. Fault tolerance is increased by adding corresponding identifiers to the bit stream. 8. A header structure is added to the first section of each stream to describe the attributes of the source image. According to the header structure, the positioning operation, extraction operation, decoding operation and image reconstruction can be completed, so that it has the characteristics of reproduction accuracy and an operation-of-interest region, and can use an optional file format to describe the image and its various components. The decoding algorithm for JPEG2000 is as follows. First, read the JPEG2000 image format file header information and file the header logo from the JPEG2000 code stream in order to extract the decoding parameters, such as image size, image block number, wavelet transform mode, and other information, and then unpack to obtain the code word. In the decoding data, each bit plane contains three processes: the cleaning process, the amplitude refining process, and the importance propagation process, which are combined with inverse arithmetic encoding to decode together. Each process will output the decoded bit stream, and carry out inverse quantization, inverse discrete wavelet transforms, and inverse multicomponent transform according to the sequence of decoding in each process, and finally output the decoded data. The decoder can extract the required part from the compressed code stream for decoding, such as extracting only a certain component or parsing only to a certain quality layer. The JPEG2000 standard gives the decoder a lot of flexibility because of its multiple decoding characteristics [20]. JPE2000 compression has the following features. Figure 9: The processing of JPEG200 encoding and decoding. (1). High compressibility  
JPEG2000 can achieve relatively higher compression multiples than other methods while ensuring higher fidelity of the reconstructed images. (2). Compatible with lossy compression and lossless compression  
It is compatible with lossy compression and lossless compression implementations. This can avoid format problems caused by inconsistent lossy and lossless compression algorithms and facilitate processing and conversion.