Clear Sky Science · en
An image compression-encryption algorithm based on BP neural network optimized with fireworks algorithm
Why protecting pictures still matters
Every photo we snap, medical scan we store, or satellite image we beam across the globe is really just data. As the number and size of these images explode, keeping them both small enough to move quickly and secure enough to keep private has become a serious challenge. Conventional tools can shrink files or scramble them, but rarely do both well at the same time. This paper introduces a smarter way to compress and encrypt images in a single pipeline, aiming to save bandwidth and storage without sacrificing security or picture quality when the image is restored.

Making pictures smaller and smarter
The core of the approach is a type of artificial neural network known as a back‑propagation (BP) network, which is good at learning compact representations of data. The authors use this network as a "squeeze" stage: each small block of an image is fed into the network, passed through a thinner hidden layer, and reconstructed at the output. Because the hidden layer has fewer neurons than input pixels, the representation in that layer is a compressed version of the original image block. When many such blocks are processed, the result is a much smaller image file that can later be expanded back into something visually close to the original.
Fireworks to tune the neural network
Training a neural network to compress images efficiently is tricky, because its performance depends heavily on the initial settings of its internal connections. If those starting weights are poor, learning can get stuck or take too long, leading to lower‑quality reconstructions. To avoid this, the authors borrow an idea from swarm intelligence called the fireworks algorithm. In this method, each candidate set of network weights is treated like a virtual firework that "explodes" into many nearby variants, exploring different possibilities. By comparing how well each candidate compresses and reconstructs images, the algorithm gradually homes in on weight settings that give low error. This extra optimization step allows the BP network to learn faster and produce higher‑quality compressed images than standard training alone.
Chaos for stronger scrambling
Compression alone does not keep prying eyes out, so the compressed image is then encrypted. Here the authors turn to chaotic systems—simple mathematical rules that produce highly unpredictable sequences. They design a new "variable‑parameter" chaotic system by combining two known chaotic maps and letting them influence each other’s parameters as they run. This produces pseudo‑random sequences that pass stringent randomness tests set by the U.S. National Institute of Standards and Technology. These sequences control how pixel positions are shuffled globally and within small blocks in multiple rounds, and how pixel values are altered using a Gray code–based bit‑level mutation process. Together, these steps thoroughly break up recognizable structure in the image, making the encrypted version look like pure noise.

Testing security and picture quality
To see whether the scheme works in practice, the authors apply it to standard test images at several compression levels. They measure how closely the decrypted images match the originals using common quality scores and show that even when file size is cut by half or more, the recovered pictures remain sharp and detailed. At the same time, statistical tests show that the encrypted images have nearly uniform pixel distributions and almost no correlation between neighboring pixels, hallmarks of strong confusion. Additional experiments add noise, cut out parts of the encrypted image, or slightly change the encryption key. In each case, the system either recovers most of the visible content when it should, or fails completely when the key is even minutely wrong—both desirable behaviors for a secure design.
What this means for everyday images
In simple terms, the study presents a way to shrink images and lock them at the same time, using a neural network that has been "tuned" by a fireworks‑like search and protected by carefully engineered digital chaos. The result is a method that can reduce storage and transmission costs while still allowing high‑fidelity recovery for authorized users and offering strong resistance to common attacks. As image data continue to grow and move across insecure networks, such combined compression–encryption schemes could help keep our photos, medical records, and other sensitive visuals both lighter and safer.
Citation: Liang, Y., Peng, B., Liu, R. et al. An image compression-encryption algorithm based on BP neural network optimized with fireworks algorithm. Sci Rep 16, 7967 (2026). https://doi.org/10.1038/s41598-026-36772-z
Keywords: image encryption, image compression, neural networks, chaotic systems, data security