This project demonstrates how linear regression combined with Fourier features can be used to compress images efficiently. Instead of working directly with pixel values, the data is transformed into a set of sine and cosine features based on Fourier series, allowing for effective compression with reduced storage requirements.
- A basic linear regression model is trained on new Fourier-transformed data.
- Tested across grayscale and colored images with CIFAR-10 dataset.
- Uses Scikit's LinearRegression with default settings
- The sine-cosine form of Fourier series is used to replace raw pixel values with frequency-based features.
- Each sample corresponds to a specific frequency of the wave, and a linear regression model learns the amplitudes of these frequencies.
- Fourier series equation (sine-cosine form)
- Compression Achieved: Compression resulted in smaller image sizes than the original data without significant loss of clarity.
- Visualization of Clarity:
- Plotted the compressed and original versions to observe how quality improves with increasing Fourier samples.
- Beyond a certain threshold, increasing samples no longer improved clarity.
-
Computational Complexity:
- The approach scales with
$O(N^2)$ , where$N$ is the number of pixels, making it impractical for large images. - FFT (Fast Fourier Transform) offers a faster
$O(N log N)$ alternative for large datasets.
- The approach scales with
- Hyperparameter Tuning: The number of Fourier samples and period were chosen manually without extensive tuning.
- Not Suitable for Bigger Images: Large images would require advanced models like neural networks for better performance.
- Hyperparameter Tuning: Experiment with different sample sizes and periods to optimize for accuracy vs. compression ratio.
- Use Autoencoders: Investigate the use of autoencoders for frequency-based feature extraction and compression.
- Wikipedia for the Fourier series equations.
- CIFAR-10 Dataset for sample images used during testing.

