<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Emmanuel Ajala on Medium]]></title>
        <description><![CDATA[Stories by Emmanuel Ajala on Medium]]></description>
        <link>https://medium.com/@emmanuelajala22?source=rss-2a5dc53efe15------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*7JPtKlvPjgA1F4Ln</url>
            <title>Stories by Emmanuel Ajala on Medium</title>
            <link>https://medium.com/@emmanuelajala22?source=rss-2a5dc53efe15------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 07:28:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@emmanuelajala22/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Image denoising with Singular Value Decomposition (SVD)]]></title>
            <link>https://medium.com/@emmanuelajala22/image-denoising-with-singular-value-decomposition-svd-8f5dda3cc259?source=rss-2a5dc53efe15------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f5dda3cc259</guid>
            <category><![CDATA[image-denoising]]></category>
            <category><![CDATA[svd]]></category>
            <dc:creator><![CDATA[Emmanuel Ajala]]></dc:creator>
            <pubDate>Wed, 16 Jul 2025 20:32:48 GMT</pubDate>
            <atom:updated>2025-07-16T20:32:48.465Z</atom:updated>
            <content:encoded><![CDATA[<h4>Overview</h4><p>Noise is absence of information; Image noise is a fundamental challenge in digital imaging, it represents loss of information in visual data and as given by second law of thermodynamics “Entropy of an isolated system always increases over time.” In digital images noise manifests as random variations in pixel values that deviate from true image signal. Once information is lost it cannot be truly recovered according to information theory, but an estimate of lost information can be made from machine learning models by leveraging mathematical tools like Singular Value Decomposition (SVD).<br><strong>How SVD solves it</strong>: Singular Value Decomposition (SVD) provides a powerful mathematical approach to image denoising by decomposing an image matrix into three fundamental components that reveal underlying structure of image data.</p><p><strong>Theoretical Foundations</strong>:<br>Image noise introduces random variations that deviate from the true signal. SVD provides a mathematical mechanism to decompose an image matrix A ∈ ℝᵐˣⁿ into three fundamental components:<br>A = UΣVᵀ</p><p>Where:</p><p>U represents left singular vectors<br>Σ is a diagonal matrix of singular values<br>V represents right singular vectors</p><p><strong>Noise Separation Mechanism</strong>:<br>Isolating information related to noise in image data is the fundamental idea behind SVD-based denoising. The hierarchical ordering of singular values based on their magnitude enables a methodical approach to information preservation. The smaller singular values contain noise-related components, whereas the top-k largest singular values contain the most important image information.</p><p>To selectively truncate singular values, the method uses a strategic thresholding approach. To preserve the image’s main structural elements, noise-carrying smaller singular values must be eliminated or reduced. By doing this, SVD successfully separates random noise from important image information.</p><p><strong>Algorithmic Approach</strong>:<br>A methodical three-step process is used in the SVD denoising process. First, Singular Value Decomposition is used to break down the noisy image matrix. Second, the singular values are subjected to a meticulously crafted thresholding technique. Lastly, the reduced set of components is used to reconstruct the denoised image.</p><p><strong>Thresholding Techniques</strong>:<br>SVD-based image denoising uses three main thresholding techniques. Complete elimination of singular values below a preset threshold is known as “hard thresholding.” Soft thresholding reduces smaller singular values gradually. Adaptive thresholding dynamically modifies the threshold according to the unique properties of the image’s noise.</p><p><strong>Advantages of SVD Denoising:</strong><br>When it comes to image denoising, SVD has several benefits. Mathematically speaking, it minimizes mean squared error while maintaining crucial image structures and offers provable convergence properties. In terms of computation, it makes use of effective linear algebraic operations, provides the possibility of parallel implementation, and exhibits exceptional scalability across a range of image sizes.</p><p><strong>Challenges and Limitations :</strong><br>Despite its merits, SVD-based image denoising is not without obstacles. With larger photos, the computational complexity rises dramatically. The best thresholding settings must be carefully chosen by researchers, necessitating advanced analytical techniques. A careful balance between noise reduction and information retention is also required because aggressive thresholding approaches may lead to the possible loss of tiny image details.</p><h4>Methodology</h4><p>SVD, known as Singular Value Decomposition is a type of data reduction tool that basically breaks down images into matrices. The steps use to achieve this includes decomposition, truncation, reconstruction, combining the channels (RGB)</p><p><strong>Decomposition</strong>:<br>Let’s say we have an image A, it gets decomposed into 3 matrices as shown below: <br>A = UΣVᵀ<br>These 3 matrices contain information about image A where U is an orthogonal matrix that represents pattern across rows of an image. It defines how the features vary vertically while VT also an orthogonal matrix that defines how the features vary horizontally and it captures the column space which is the horizontal structure of the image. ∑ is a diagonal matrix that contains the singular values and it defines the level of importance of each component of the image. The image below represents the first step if the image is in color;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*VNR1HBzGe7BbyZqov_ApGA.png" /></figure><p><strong>Truncation:</strong><br>The diagonal matrix( ∑ ), which contains the singular values tells us the most important parts of the image and we retain its top k singular values alongside its corresponding vectors in U and VT to reduce the size of the data and or denoise the image. The more singular value being kept, the closer it is to the original image. For example, if we keep 5 singular values, the image doesn’t look as clear as when we keep 20 singular values. How the select K also varies depending on the context, we look at the image complexity and the noise levels. In a case of high noise levels, it may benefit from lower K values. During this process, an approximation Ak is derived as shown below Ak = Uk∑kVkT Uk represents the first column of U ∑k represents the diagonal matrix of the largest singular values VkT represents the first row of V</p><p><strong>Reconstruction</strong>:<br>In the reconstruction process, Uk , ∑k and Vkᵀ are combined to reconstruct Ak. These values are stored as opposed to storing the full matrix.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*L1VIadpPWS_C3PqW1Z8eKQ.png" /></figure><p>The first column of U, largest values is ∑ and first row of V are picked in this stage. After this step, we evaluate the compression ratio and use reconstruction error metrics like Peak Signal to Noise Ratio (PSNR), Mean Squared Error (MSE) to see how well the compression performed and also how clean the image is in a case of denoising. The formula used for the compression ratio is shown below;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*5MqO9JAXOeaN8MlendRokg.png" /></figure><h4>Experiment</h4><p><strong>Setup</strong>:<br> The datasets used in this analysis were the Canadian Institute for Advanced Research, 10 classes (CIFAR-10) and the Modified National Institute of Standards and Technology database (MNIST). CIFAR-10 contains 60,000 32x32 images across 10 different classes. The dataset is broken into 50,000 training images and 10,000 testing images. MNIST is made up of 70,000 28x28 images of handwritten digits, with 60,000 training images and 10,000 testing images. The images in MNIST are all black and white images, while the CIFAR-10 images were converted to greyscale instead of remaining as their default color images. After researching different methods for downloading and unpacking each of these datasets, I decided to use the Python library TensorFlow (version 2.10.0) to load the datasets into my environment. The datasets can be easily loaded and split into training and testing sets through the tensorflow keras API with the function ‘load_data()’.</p><p><strong>Tools/Libraries</strong>: <br>Conda version 23.5.2 was used to install and maintain all required Python libraries. Libraries used in this analysis include: numpy (1.24.), matplotlib (3.5.3), scikit-image (0.20.0), scikit-learn (1.3.0), keras (2.10.0), tensorflow (2.10.0), and pandas (1.5.3).</p><p><strong>Metrics for Evaluation:</strong> <br>Several different methods were employed to thoroughly evaluate the performance of the image denoising process. Peak Signal-to-Noise Ratio (PSNR) measures the ratio between the power of a signal and the power of noise that affects the image quality.</p><p><strong>PSNR Formula</strong></p><p>The Peak Signal-to-Noise Ratio (PSNR) is calculated using the following formula:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*lVyZD40Ua9neEcELDTMoqA.png" /></figure><p>Where:</p><ul><li>MAX is the maximum possible pixel value of the image (e.g., 255 for 8-bit images).</li><li>MSE is the Mean Squared Error between the original and the distorted image.</li></ul><p>Mean Squared Error (MSE) was also used as a metric to evaluate the performance of the model. MSE is useful for assessing the error between the original image and the reconstructed image by calculating the sum of squared differences. The formula for MSE is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*bIOP8puDXfykVYEOM3D8lQ.png" /></figure><p>Where:</p><ul><li>m and n are the dimensions of the image.</li><li>I(i, j) is the pixel value of the original image at position (i, j).</li><li>I’(i, j) is the pixel value of the compressed or noisy image at position (i, j).<br> <br>The final method of performance evaluation used is the Structural Similarity Index (SSIM), which is used to measure the similarity between images on a scale ranging from -1 to 1. This method takes into account the luminance, contrast, and structure of an image. The formula for SSIM is:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*Sc4FOpHJxaczuFI_xQfwQQ.png" /></figure><p>Where:</p><ul><li>μI and μI’ are the average pixel values of the original and compressed/noisy images.</li><li>σI and σI’ are the standard deviations of the pixel values of the original and compressed/noisy images.</li><li>σII’ is the covariance between the original and compressed/noisy images.</li><li>C1 and C2 are constants to stabilize the division.</li></ul><h4>Results</h4><p><strong>Performance Evaluation</strong>:<br>The code performs SVD-based image denoising by testing different values of k (number of singular values retained). It evaluates the denoised images using three metrics:</p><ul><li>PSNR (Peak Signal-to-Noise Ratio): Measures image quality improvement compared to noisy images.</li><li>MSE (Mean Squared Error): Quantifies the average error between the original and denoised images.</li><li>SSIM (Structural Similarity Index): Assesses perceptual similarity between images.</li></ul><p>In terms of lowering noise while maintaining image details, the SVD-based image denoising technique showed encouraging results. The reconstructed images showed better clarity and sharpness as the k value rose. Nonetheless, a trade-off between computational cost and denoising performance was noted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*rd5--xekNNeNZMSOpmC16A.png" /></figure><p><strong>Key Findings</strong>:<br>Impact of k Value:</p><ul><li>Increasing the k value generally led to better denoising performance, as more significant singular values were retained.</li><li>However, excessively large k values introduce overfitting and potential artifacts.</li></ul><p><strong>Dataset Comparison: </strong><br>The technique was effective on both CIFAR-10 and MNIST datasets, indicating its versatility. The optimal k value might vary between datasets due to differences in image complexity and noise characteristics.</p><h4>In-Depth Performance Analysis</h4><p><strong>PSNR (Peak Signal-to-Noise Ratio): </strong><br>The PSNR calculates the ratio of a signal’s maximum power to that of corrupting noise. Better quality is indicated by a higher PSNR. Despite its widespread use, PSNR has drawbacks.</p><ul><li>It is quite sensitive to significant variations in pixels.</li><li>Because it ignores structural information, it might not fairly represent perceived quality.</li></ul><p><strong>MSE (Mean Squared Error):</strong><br>The average squared difference between the values of the original and reconstructed pixels is determined by MSE. Better denoising performance is indicated by a lower MSE. Nevertheless, MSE has the same drawbacks as PSNR :</p><ul><li>It is susceptible to significant inaccuracies at the pixel level.</li><li>It might not match up well with how people perceive the quality of images.</li></ul><p><strong>SSIM (Structural Similarity Index)</strong>:<br>A more complex statistic called SSIM considers structural data like structure, contrast, and brightness. It is more in line with how people perceive the quality of images. SSIM is a better option for evaluating the preservation of image information since it is less susceptible to small distortions and noise.</p><p><strong>Choosing the Right Metric</strong>:<br>The application and the intended quality evaluation determine which measure is used. A more thorough assessment can frequently be obtained by combining many indicators. PSNR and SSIM together are frequently advised for SVD-based picture denoising:</p><ul><li>PSNR: Indicates the total amount of noise reduction.</li><li>SSIM: Evaluates how well image structure and detail are maintained.<br>One can learn more about the efficacy of the denoising process by examining both measurements. For example, good noise reduction and detail preservation are indicated by high PSNR and SSIM. A low SSIM and a high PSNR, however, could indicate over-smoothing, in which detail is sacrificed in order to reduce noise.</li></ul><p><strong>MNIST dataset:</strong><br>Images were taken from the MNIST dataset. To create a noisy environment, Gaussian noise was applied to the original photos. Three measures were used to assess the reconstructed images after the noisy images were subjected to the SVD-based denoising technique:</p><p><strong>Peak Signal-to-Noise Ratio (PSNR)</strong>: Calculates the pixel-by-pixel difference between the original and reconstructed pictures. Better quality is indicated by a higher PSNR.<br>The average squared difference between the original and reconstructed pixels is determined by the Mean Squared Error (MSE). Better rebuilding is indicated by a lower MSE.<br>By taking into account elements including brightness, contrast, and structure, the Structural Similarity Index (SSIM) calculates how structurally similar the original and reconstructed images are. Better image detail preservation is indicated by a higher SSIM.</p><p><strong>Results:</strong><br>For a range of values of k, the number of singular values preserved during reconstruction, the graph shows the effectiveness of SVD-based denoising.</p><p>As k grows, PSNR and SSIM both significantly increase, suggesting that higher image quality results from keeping more singular values. But as k gets closer to greater values, the pace of improvement slows down. This implies that the key information in the image can be captured by a limited number of single values.</p><p>MSE: As k rises, the MSE gradually falls, suggesting that the reconstructed images get more accurate as the number of singular values increases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*5JvR5CgNsjq3ODAzZ2XA1A.png" /></figure><p><strong>CIFAR dataset:</strong></p><p>Images were taken from the CIFAR-10 dataset. The SVD-based denoising technique was used after adding Gaussian noise to the original images. The performance was assessed using the same three metrics (PSNR, MSE, and SSIM).</p><p>The graph shows how well SVD-based denoising performs on the CIFAR-10 dataset for various values of k.</p><p>The pattern of PSNR and SSIM is comparable to that of the MNIST dataset, exhibiting a sharp rise at first, followed by a more gradual improvement. Nevertheless, the overall performance is worse than MNIST, suggesting that color image denoising is more difficult.</p><p>MSE: Like the MNIST dataset, the MSE slowly declines as k rises. The slower rate of decline, however, indicates that more unique values are required to attain similar denoising performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*36dNIfhqP_R-vrwewwQcdQ.png" /></figure><h4>Conclusion</h4><p>On the MNIST and CIFAR-10 datasets, the SVD-based image denoising method has demonstrated efficacy in lowering noise and maintaining picture details. The selection of the k parameter, which regulates the number of singular values preserved during reconstruction, affects the technique’s performance.<br>A lower k value can greatly enhance image quality for both datasets. However, the marginal performance improvement decreases as k rises. This implies that computing complexity and noise reduction need to be carefully balanced.<br>Even though the SVD-based method works well, more investigation is required to maximize the k selection procedure. The effectiveness of this methodology could be further improved by adaptive techniques that can automatically identify the ideal k value for various images and noise levels.</p><p>[Check the full code on github] (<a href="https://github.com/Ajalaemmanuel/Image-denoising-with-SVD/blob/main/Image_Denoising_SVD_v2%201.ipynb">Image-denoising-with-SVD/Image_Denoising_SVD_v2 1.ipynb at main · Ajalaemmanuel/Image-denoising-with-SVD</a>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f5dda3cc259" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning Models that Remember Too Much: A Review]]></title>
            <link>https://medium.com/@emmanuelajala22/machine-learning-models-that-remember-too-much-a-review-138152971447?source=rss-2a5dc53efe15------2</link>
            <guid isPermaLink="false">https://medium.com/p/138152971447</guid>
            <dc:creator><![CDATA[Emmanuel Ajala]]></dc:creator>
            <pubDate>Thu, 10 Apr 2025 22:31:49 GMT</pubDate>
            <atom:updated>2025-04-12T17:49:22.491Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CqgB-qwi0Xis-V4wd_dTLw.jpeg" /></figure><h3>Problem Addressed</h3><p>The paper on Machine Learning Models that Remember Too Much discusses how data that be easily extracted from large language models(LLMs) by using a query access called the black box query access. In this paper, some solutions were discussed and it shows how the type of data you choose to share matters in terms on privacy because these models remember these individual data even the sensitive ones.</p><p>This is a big problem because when you train these LLMs with sensitive data, they can be easily extracted by an opposition or someone who shouldn’t have access to these data.</p><h3>Method/Approach</h3><p>Since we are aware of this problem, how do we tackle it? This paper talks about ways to solve the issue which includes</p><p>· Being selective about the data being used in the training of these models</p><p>· Avoiding duplicates</p><p>· Being careful during fine tuning</p><p>· Understanding how to balance the size of data to large models because the larger the model, the more prone they are to memorizing sensitive data</p><p>· Avoiding the use of training with public data and so many more.</p><h3>Strengths &amp; Weaknesses</h3><p>The paper points out the use of perplexity which I found interesting. Perplexity metric was highlighted to be a good way to discover how to know when a model finds a new information, it’s basically a way to see how surprised the model and the more surprised it is, the newer the data is to the model. A higher perplexity often signals that the model is seeing something unfamiliar, which can hint at memorization.</p><p>However, the paper uses GPT 2 as a sample for large language model but the research wasn’t extended into newer architectures which have new additions to their technologies and the paper doesn’t extensively tell us how the performance will be in this newer LLMs.</p><h3>Takeaways</h3><p>This paper is a powerful reminder that privacy concerns go beyond performance metrics. Training data selection matters not just for model accuracy but also for protecting users. Implementing the recommended precautions is essential, though it might come at the cost of increased computational overhead.</p><h3>Reference</h3><p><a href="https://doi.org/10.1145/3133956.3134077">Song, C., Ristenpart, T., &amp; Shmatikov, V. (2017). <em>Machine learning models that remember too much</em>. In <em>Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security</em> (pp. 587–601). ACM.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=138152971447" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>