Method for dictionary learning and sparse coding

By strategically selecting image patches and leveraging signal features, the method enhances the reconstruction fidelity of high-resolution images from sparse sampled data, addressing noise and feature loss issues in existing techniques.

WO2026115271A1PCT designated stage Publication Date: 2026-06-04SENSEAI VISION LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
SENSEAI VISION LTD
Filing Date
2025-11-28
Publication Date
2026-06-04

AI Technical Summary

Technical Problem

Existing dictionary learning and sparse coding techniques face challenges in reconstructing high-resolution images from sparse sampled data due to noise and feature loss, particularly when approaching very low sampling percentages, leading to degraded reconstruction quality and reduced reliability of quantitative analyses.

Method used

The method involves selecting image patches based on predefined criteria to generate a dictionary, retaining elements that produce accurate reconstructions, and leveraging signal features like high and low frequency components to enhance reconstruction fidelity.

Benefits of technology

The approach improves image reconstruction quality by selectively using dictionary elements that are more likely to contribute to accurate reconstructions, enhancing the visibility of fine structural details and improving resolution of lattice orientations and atomic-scale features.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure GB2025052612_04062026_PF_FP_ABST
    Figure GB2025052612_04062026_PF_FP_ABST
Patent Text Reader

Abstract

Broadly speaking, the present techniques generally relate to improving image reconstruction through dictionary learning and sparse coding algorithms and making these algorithms more effective. In particular, the present techniques relate to selecting patches, based on some criteria, that are used to construct a dictionary so that the dictionary produces reconstructions that are tailored to those criteria.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] AL Ref: P46900W01 28 November 2025

[0002] Method for Dictionary Learning and Sparse Coding

[0003] Field

[0004]

[0001] Embodiments of the present techniques generally relate to dictionary learning and sparse coding. In particular, the present application relates to a method for generating a sparse dictionary for reconstructing images.

[0005] Background

[0006]

[0002] High-resolution imaging in electron microscopy is a powerful technique for characterising materials’ structure and composition up to the atomic scale. Achieving high spatial resolution imaging requires both an adequate signal to noise ratio (SNR), via the use of a high number of electrons, and a very small electron probe, which improves imaging resolution but increases the electron density. This combination leads to high electron doses which may lead to beam-induced structural alterations to the sample. Therefore, a focus of ongoing research is developing mitigation strategies to reduce the total electron fluence when the sample is exposed to the electron beam during image I data acquisition.

[0007]

[0003] One such approach developed and studied in recent years is the use of compressive sensing (CS), which incorporates sparse data acquisition and inpainting. Sparse data is acquired by sampling only a fraction of the available image pixels. An inpainting algorithm is used to subsequently reconstruct missing pixels to generate a full signal output. A particularly powerful class of reconstruction techniques involves Bayesian dictionary learning, such as beta-process factor analysis (BPFA), which learns a dictionary, a sparse overcomplete representation of image patches, and corresponding weights, which are subsequently used to reconstruct full-resolution images from incomplete data. This method has demonstrated strong performance across a range of different electron microscopy techniques, such as 4D-STEM, electron energy loss spectroscopy (EELS), and both high-angle annular dark field and bright field (BF) STEM imaging.

[0008]

[0004] Thus, sparse coding, also known as sparse dictionary learning, is a representation learning method that aims at finding a sparse representation of input data in the form of a linear combination of basic elements, as well as those basic elements themselves. These elements are often known as “atoms”, and the elements / atoms form a dictionary. In other words, the aim of sparse coding is to find a set of basis vectors (elements / atoms) that enable an input vector as a linear combination of these basis vectors. In the context of images, the AL Ref: P46900W01 28 November 2025 linear combination of basis vectors enable any image to be constructed from an input image which has been captured using sparse sampling. In other words, the constructed image may “fill in” data that was not captured during the sampling / imaging process.

[0009]

[0005] Often, it is desirable to learn an over-complete set of basis vectors, because these are better able to capture structures and patterns in the input data. However, with an overcomplete set of basis vectors. The vectors in an over-complete set of basis vectors do not have to be orthogonal. The additional criterion of sparsity is introduced to resolve the degeneracy caused by over-completeness. Sparsity means the elements of the basis vectors are mostly zero. In other words, an image from a dataset used to build the dictionary can be constructed using few basis vectors from the dictionary.

[0010]

[0006] The dictionary enables new images can be generated (or constructed from sparse sampled images) that will look like they were sampled from the dataset used to build the dictionary.

[0011]

[0007] Dictionary learning and sparse coding methods have been demonstrated to be useful in the recovery of low signal and sparse sampled images in electron microscopy, with a methodology that is easily adaptable to other imaging techniques, such as lithography and mass spectroscopy.

[0012]

[0008] Despite the advantages of dictionary learning and sparse coding techniques, subsampled imaging and subsequent inpainting face challenges related to noise and feature loss. When pushing boundaries and approaching a very low sampling percentage, the reconstruction quality degrades and reduces the reliability of quantitative analyses. Structural features such as lattice fringes, defect atoms, or isolated atoms may be poorly recovered if the dictionary learning algorithm fails to capture the relevant spatial frequencies.

[0013]

[0009] The present applicant has therefore identified the need for an improved dictionary learning and sparse coding.

[0014] Summary

[0015]

[0010] In a first approach of the present techniques, there is provided a computer-implemented method for generating a sparse dictionary for reconstructing images, the method comprising: obtaining a dataset comprising at least one image; for each image in the dataset: converting AL Ref: P46900W01 28 November 2025 the image into a plurality of patches; selecting a subset of patches from the plurality of patches using at least one predefined criterion; and generating a dictionary by: generating a plurality of potential dictionary elements from the selected subset of patches using a dictionary learning algorithm; reconstructing the image using two or more dictionary elements in a linear combination; and retaining, in the dictionary, the potential dictionary elements that are used to reconstruct the image.

[0016]

[0011] Advantageously, the present techniques address the issue of blurring in existing dictionary learning and sparse coding techniques by leveraging the fact that signals or data typically have different features, such as high and low frequency components. This is leveraged by purposefully selecting certain patches which are used to generate a dictionary, instead of simply randomly selecting those patches (as done by existing techniques). Thus, instead of randomly selecting patches, which means that each patch has an equal chance of being selected to form a batch, the present techniques select the patches based on at least one predefined criterion, which ensures that certain patches have a higher or lower chance of being selected.

[0017]

[0012] The potential dictionary elements may be retained in the dictionary based on whether they produce reconstructed images having a predefined accuracy or having a predefined maximum error. Additionally or alternatively, the potential dictionary elements are retained in the dictionary if the difference between the reconstructed image and the original image (ground truth) is less than a predefined tolerance. If the difference is less than the tolerance, then the process to generate the dictionary can be stopped as the reconstruction is good enough.

[0018]

[0013] There are a number of example ways that the subset of patches may be selected. Some of these are now described.

[0019]

[0014] A first example way to select a subset of patches using at least one predefined criterion may comprise: estimating, for each patch, a likelihood that a dictionary element generated from the patch will be used to reconstruct the patch. That is, it may be possible to determine whether a dictionary element created from a patch is likely to be used to reconstruct the patch. If the dictionary element is highly likely to be used it will be assigned a higher likelihood value than a dictionary element that is unlikely to be used or not used at all. AL Ref: P46900W01 28 November 2025

[0020]

[0015] Thus, in this first example, selecting a subset of patches may comprise: selecting a subset of patches from which dictionary elements are generated with a high likelihood of being used to reconstruct the subset of patches. This means that the dictionary is not populated with dictionary elements that are unlikely to be used, which helps to generate a dictionary of useful dictionary elements.

[0021]

[0016] In this first example, the step of selecting a subset of patches may comprise: clustering the plurality of patches into at least two clusters; and selecting a subset of patches from at least one cluster. The clustering may be performed based on features of the patches. For example, the clustering may be based on the estimated likelihood of one or more dictionary elements generated from a patch being used in a reconstruction. In another example, the clustering may be based on different regions of the image, i.e. clustering together patches coming from the same or similar regions of the image (e.g. background, foreground, etc.) The clustering may enable patches of interest to be selected more easily based on their characteristics.

[0022]

[0017] In a second example, selecting a subset of patches using at least one predefined criterion may comprise using any one or more of: a data value of each patch; a darkness value of each patch; a brightness value of each patch; a standard deviation of each patch; a gradient of each patch; and a spatial frequency value of each patch. It will be understood that these are some non-limiting and non-exhaustive example criteria.

[0023]

[0018] In this second example, selecting a subset of patches using at least one predefined criterion may comprise: obtaining the at least one predefined criterion and a threshold value for the at least one predefined criterion; and selecting a subset of patches by selecting all patches that have a value above or below the threshold value for the at least one predefined criterion. The at least one predefined criterion may be obtained from a human operator or elsewhere, and may be specific to the type of images being reconstructed. The subset of patches may be all the patches that have a value greater than the threshold value, because these patches may help to generate a reconstruction of a required resolution / accuracy. Alternatively, the subset of patches may be all the patches that have a value lower than the threshold value, because these patches may help to generate a reconstruction of a required resolution / accuracy.

[0024]

[0019] Alternatively, in this second example, selecting a subset of patches using at least one predefined criterion may comprise: obtaining the at least one predefined criterion and a AL Ref: P46900W01 28 November 2025 threshold value for the at least one predefined criterion; selecting a first subset of patches from the patches that have a value below (or above) the threshold value for the at least one predefined criterion; and selecting, after selection of the first subset, a second subset of patches from the patches that have a value above (or below) the threshold value for the at least one predefined criterion. That is, the first subset of patches is selected first because these are patches that are more important for generating a reconstruction of a required resolution / accuracy. Then, the dictionary may be populated using dictionary elements generated from the second subset of patches, which are patches that are less important for generating the reconstruction. In this way, certain patches are prioritised, which helps to overcome the above-mentioned problem with existing dictionary learning techniques.

[0025]

[0020] Alternatively, in this second example, selecting a subset of patches using at least one predefined criterion may comprise: obtaining the at least one predefined criterion; determining a likelihood of each patch of the plurality of patches being selected based on the obtained at least one predefined criterion; and selecting a first subset of patches from the patches that have a low likelihood of being selected; and selecting, after the selection of the first subset, a second subset of patches from the patches that have a higher likelihood of being selected. Again, here, the first subset of patches is chosen first because these are the patches that are most important for generating a reconstruction of a required resolution / accuracy.

[0026]

[0021] Generally, the step of generating a dictionary may further comprise: determining, for each dictionary element, a frequency of use of the dictionary element to reconstruct the image; and adjusting weights of each dictionary element in the dictionary using the determined frequency. That is, a known or an estimated frequency of use of each dictionary element is utilised. The frequency of use is used to adjust weights of each dictionary element (i.e. the dictionary, which, after sparse coding, may be considered a weighted dictionary). By manipulating individual elements, rows or columns of the dictionary, it is possible to change the effect that different dictionary elements have on the reconstruction of the data. This can be used to enhance the resolution of the final reconstruction and provide improvement.

[0027]

[0022] The step of obtaining a dataset comprising at least one image may comprise obtaining at least one image captured by a microscope or other imaging device. In some cases, the image may be acquired using a sparse imaging / acquisition process, such that the present techniques may be used to reconstruct the image using sparse data. Sparse imaging processes may speed-up the imaging process, and when combined with the present AL Ref: P46900W01 28 November 2025 techniques, a reconstruction that is nearly as good as an image obtained by a complete / non- sparse acquisition process.

[0028]

[0023] In some cases, generating a plurality of potential dictionary elements may comprise using two or more dictionary learning algorithms. As explained in more detail below with reference to the Figures, different dictionary learning algorithms have their own advantages and disadvantages and therefore, it may be useful to form a dictionary having dictionary elements generated by multiple dictionary learning algorithms to harness their individual advantages.

[0029]

[0024] In some cases, a single dictionary may be generated, where generating a plurality of potential dictionary elements may comprise: generating, using each of the dictionary learning algorithms, a plurality of potential dictionary elements from the selected subset of patches. Then, the dictionary elements from each algorithm may be combined in any way to generate an improved reconstruction.

[0030]

[0025] In some cases, a single dictionary may be generated by applying different dictionary learning algorithms to different regions of the images. In this case, selecting a subset of patches may comprise selecting two or more subsets of patches (e.g. from different regions), and generating a plurality of potential dictionary elements may comprise: generating, by applying a different dictionary learning algorithms to each of the two or more subsets of patches, a plurality of potential dictionary elements for the subsets of patches. This takes advantage of the fact that some dictionary learning algorithms may be better at reconstructing certain regions, e.g. background or foreground.

[0031]

[0026] In either case, the step of reconstructing the image may comprise using two or more dictionary elements generated by the two or more dictionary learning algorithms.

[0032]

[0027] When generating dictionary elements for specific regions of an image, the regions may be normalised in terms of size and scale, to aid patch selection from each region. This means that each patch may be of the same size. However, this means that when an image is being reconstructed, the patches, and therefore the dictionary elements generated from those patches, are all the same size. To reconstruct the image properly, an inverse normalisation needs to be applied during the reconstruction to ensure the reconstructed image has the right size and scale in all regions. Thus, reconstructing the image may, in some cases, comprise AL Ref: P46900W01 28 November 2025

[0033] (reverse / inverse) normalising the reconstructed image to a scale determined by the image from the dataset.

[0034]

[0028] In some cases selecting a subset of patches may comprise exclusively or preferentially selecting the subset of patches from subregions of the image that are of interest. As explained in more detail below with reference to the Figures, selecting patches primarily from, or only from, certain subregions of the image may enable the quality of the reconstruction of those subregions to be improved. This may be useful because the subregions may contain information that is particularly important. This means that less, or no, time is spent reconstructing other regions that are not important (e.g. the background).

[0035]

[0029] Generally speaking, the dictionary learning algorithm may be any of: a k-means clustering singular value decomposition, k-SVD, algorithm; and a beta process factor analysis, BPFA, algorithm.

[0036]

[0030] The step of obtaining a dataset comprising at least one image may comprise obtaining at least one image captured using any one of: an electron microscope, EM; a scanning electron microscope, SEM (including volume SEM); a Focused Ion Beam scanning electron microscope, FIBSEM; a transmission electron microscope, TEM; a scanning transmission electron microscope, STEM (including 2D STEM and 4D STEM); an ion-based microscope; and a helium ion microscope. It will be understood that these are non-limiting and non- exhaustive example image capture techniques, and that the present techniques can apply to any other imaging or microscopy techniques. More generally, the present techniques enable real-time ‘live’ subsampled image (or video frame) reconstruction via dictionary learning, aimed at use in commercial electron microscopy applications. The potential applications of the present techniques include any raster-scan imaging system, such as an electron microscope, for which scanning time is significant; by drastically reducing the quantity of measurements (and thus time) needed for the formation of a complete image.

[0037]

[0031] While the present techniques generally relate to electron microscopy images of samples, more generally, the methods may be applied to any ^-dimensional image data, such as images of samples acquired using other analytical techniques. Hence, for example, the first approach provides a method of generating a sparse dictionary for reconstructing any N- dimensional image data of a sample obtained due to interaction of electromagnetic radiation and / or particles with the sample. Examples include e-beam lithography, proton lithography, ion beam lithography, optical lithography, ion beam imaging, and focussed ion beams. In AL Ref: P46900W01 28 November 2025 other words, while the method according to the first approach may relate to electron microscopy images of samples, the method may be applied mutatis mutandis to other imaging methods, for example for optical and X-ray techniques as well as images of basic physical properties such as band structure. Hence, more generally, the first approach provides a method of generating a sparse dictionary for reconstructing ^-dimensional image data comprising physical properties of a chemical, material and / or biological system and images produced of those systems by interaction with light, X-rays, protons, neutrons and / or electrons or by any other means.

[0038]

[0032] In a second approach of the present techniques, there is provided a computer- implemented method for reconstructing sparse sampled images, the method comprising: obtaining sparse image data corresponding to a sparse sampled image; obtaining at least one dictionary generated using any of methods described with respect to the first approach; and reconstructing the image using the at least one obtained dictionary to generate pixels of the sparse sampled image that are missing from the sparse image data.

[0039]

[0033] The comments made above about the types of images that may be reconstructed apply equally to the second approach.

[0040]

[0034] In a third approach of the present techniques, there is a computer-implemented method for reconstructing sparse sampled images using multiple dictionaries, the method comprising: obtaining sparse image data corresponding to a sparse sampled image; obtaining two or more dictionaries; and reconstructing the image using the two or more obtained dictionaries to generate pixels of the sparse sampled image that are missing from the sparse image data.

[0041]

[0035] The comments made above about the types of images that may be reconstructed apply equally to the third approach.

[0042]

[0036] The step of obtaining two or more dictionaries may comprise obtaining at least one dictionary that has been generated using any of the methods describe above with respect to the first approach.

[0043]

[0037] Reconstructing the image may comprise using each dictionary to reconstruct different regions of the sparse sampled image, for the reasons described above. AL Ref: P46900W01 28 November 2025

[0044]

[0038] In a fourth approach of the present techniques, there is provided an imaging device comprising at least one processor coupled to memory configured to implement the method of the second and / or third approach of the present techniques.

[0045]

[0039] The comments made above about the types of images that may be reconstructed, and therefore, the types of imaging devices that may be used, apply equally to the fourth approach.

[0046]

[0040] In a related approach of the present techniques, there is provided a computer-readable storage medium comprising instructions which, when executed by a processor, causes the processor to carry out any of the methods described herein.

[0047]

[0041] As will be appreciated by one skilled in the art, the present techniques may be embodied as a system, method or computer program product. Accordingly, present techniques may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.

[0048]

[0042] Furthermore, the present techniques may take the form of a computer program product embodied in a computer readable medium having computer readable program code embodied thereon. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable medium may be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing.

[0049]

[0043] Computer program code for carrying out operations of the present techniques may be written in any combination of one or more programming languages, including object oriented programming languages and conventional procedural programming languages. Code components may be embodied as procedures, methods or the like, and may comprise subcomponents which may take the form of instructions or sequences of instructions at any of the levels of abstraction, from the direct machine instructions of a native instruction set to high- level compiled or interpreted language constructs.

[0050]

[0044] Embodiments of the present techniques also provide a non-transitory data carrier carrying code which, when implemented on a processor, causes the processor to carry out any of the methods described herein. AL Ref: P46900W01 28 November 2025

[0051]

[0045] The techniques further provide processor control code to implement the abovedescribed methods, for example on a general purpose computer system or on a digital signal processor (DSP). The techniques also provide a carrier carrying processor control code to, when running, implement any of the above methods, in particular on a non-transitory data carrier. The code may be provided on a carrier such as a disk, a microprocessor, CD- or DVD- ROM, programmed memory such as non-volatile memory (e.g. Flash) or read-only memory (firmware), or on a data carrier such as an optical or electrical signal carrier. Code (and / or data) to implement embodiments of the techniques described herein may comprise source, object or executable code in a conventional programming language (interpreted or compiled) such as Python, C, or assembly code, code for setting up or controlling an ASIC (Application Specific Integrated Circuit) or FPGA (Field Programmable Gate Array), or code for a hardware description language such as Verilog (RTM) or VHDL (Very high speed integrated circuit Hardware Description Language). As the skilled person will appreciate, such code and / or data may be distributed between a plurality of coupled components in communication with one another. The techniques may comprise a controller which includes a microprocessor, working memory and program memory coupled to one or more of the components of the system.

[0052]

[0046] It will also be clear to one of skill in the art that all or part of a logical method according to embodiments of the present techniques may suitably be embodied in a logic apparatus comprising logic elements to perform the steps of the above-described methods, and that such logic elements may comprise components such as logic gates in, for example a programmable logic array or application-specific integrated circuit. Such a logic arrangement may further be embodied in enabling elements for temporarily or permanently establishing logic structures in such an array or circuit using, for example, a virtual hardware descriptor language, which may be stored and transmitted using fixed or transmittable carrier media.

[0053]

[0047] In an embodiment, the present techniques may be realised in the form of a data carrier having functional data thereon, said functional data comprising functional computer data structures to, when loaded into a computer system or network and operated upon thereby, enable said computer system to perform all the steps of the above-described method.

[0054] Brief description of the drawings

[0055]

[0048] Implementations of the present techniques will now be described, by way of example only, with reference to the accompanying drawings, in which: AL Ref: P46900W01 28 November 2025

[0056]

[0049] Figure 1 is a schematic diagram showing an overview of dictionary learning;

[0057]

[0050] Figure 2 is a flowchart of steps of existing techniques to perform dictionary learning and sparse coding;

[0058]

[0051] Figures 3A and 3B show, respectively, an input image and a reconstruction of the input image generated via a standard sparse-coding algorithm;

[0059]

[0052] Figures 4A and 4B show two reconstructions of an input image generated by reweighting a weight matrix in two different ways;

[0060]

[0053] Figure 5A shows a normally generated dictionary, while Figure 5B shows a ranked dictionary generated using the present techniques;

[0061]

[0054] Figure 5C is a flowchart of example steps of technique (i) to perform dictionary learning and sparse coding;

[0062]

[0055] Figure 6 shows the impact of present technique (i) (i.e. the process shown in Figure 5C) on a reconstruction;

[0063]

[0056] Figures 7A to 7C show, respectively, an original image, a first reconstruction using a weight matrix, and a second reconstruction using a re-weighted version of the weight matrix used for the first reconstruction;

[0064]

[0057] Figures 8A to 8C show a zoomed-in view of the same section of the images in Figures 7A to 7C;

[0065]

[0058] Figure 9 is a flowchart of example steps of technique (ii) to perform dictionary learning and sparse coding, using multiple dictionary learning algorithms;

[0066]

[0059] Figure 10 is a flowchart of example steps of technique (iii) to perform dictionary learning and sparse coding;

[0067]

[0060] Figure 11 shows the impact of present technique (iii);

[0068]

[0061] Figure 12 is a flowchart of example steps of technique (iv) to perform dictionary learning and sparse coding;

[0069]

[0062] Figure 13 shows the impact of present technique (iv); and

[0070]

[0063] Figure 14 is a flowchart of example steps of a computer-implemented method for generating a sparse dictionary for reconstructing images.

[0071] Detailed description of the drawings

[0072]

[0064] Broadly speaking, the present techniques generally relate to improving image reconstruction through dictionary learning and sparse coding algorithms and making these algorithms more effective. In particular, the present techniques relate to selecting patches, based on some criteria, that are used to construct a dictionary so that the dictionary produces reconstructions that are tailored to those criteria. AL Ref: P46900W01 28 November 2025

[0073]

[0065] As explained above, existing techniques for sparse sampling and dictionary correction focus on: the use of sparse sampling to create fast image simulations; the transfer of dictionary elements from one image type to another to create new contrast mechanisms; and computational approaches to the reconstruction of the image that permits live imaging. In these existing techniques, the reconstruction of complete images from the sparse sampled acquisition relies on the dictionary elements and their weightings, which are produced by iterative dictionary learning and sparse-coding algorithms that are repeatedly applied until convergence is reached (such as beta process factor analysis, BPFA). A problem that has been identified with these existing techniques is that as the signal-to-noise ratio and / or sampling fraction is decreased, the final reconstruction becomes blurred.

[0074]

[0066] The present techniques propose addressing this problem in order to improve signal recovering or image reconstruction in dictionary learning and sparse coding methods. The present techniques leverage the separation and / or classification of signal features (e.g. high and low frequency components) in an image either before or after the reconstruction process. Note, the “reconstruction” process is referred to interchangeably herein as “inpainting”.

[0075]

[0067] More specifically, the present techniques propose a set of alterations to the traditional BPFA-based compressive sensing pipeline aimed at improving reconstruction fidelity. The present techniques focus on two key innovations. Firstly, the present techniques focus on the dictionary atoms and how they are used to form the final reconstruction. The present techniques reorder and group dictionary atoms based on two different factors: (i) the frequency of each atom’s usage in reconstructing individual patches, and (ii) the order in which the atoms are used in calculating the estimation for each individual patch. Secondly, the present techniques comprise a preprocessing step, during which the sparse data is normalized on a patch-wise basis. This improves the local contrast of the patches prior to the computational steps of the algorithm. This is done to aid the learning process of the dictionary atoms and the corresponding sparse weights. By integrating these modifications into the original BPFA workflow, the present techniques demonstrate enhanced visibility of fine structural details, including improved resolution of lattice orientations and better identification of atomic-scale features, e.g. defects.

[0076]

[0068] There are four main components of the present techniques: i. Separation or classification of sub-regions that are identified in an image or signal; AL Ref: P46900W01 28 November 2025 ii. Reconstructing an image or signal by combining individual reconstructions produced using multiple dictionaries; iii. Normalisation of identified sub-regions, and use of normalised sub-regions in a dictionary learning and sparse coding process; and iv. Reconstructing an image or signal by selectively reconstructing certain sub-regions.

[0077] These four components are described in more detail below. Some important context / background information is now provided to aid understanding of these four components.

[0078]

[0069] Dictionary learning: Dictionary learning is a sparse encoding scheme. The term “dictionary learning” is used interchangeably herein with the term “sparse coding”. In a standard dictionary learning / sparse coding process, an image is first unwrapped into a plurality of patches. Each patch is a small region of the image, and may be a square region (e.g. 8 x 8 pixels) or rectangular region (e.g. 8 x 12 pixels). A dictionary is then iteratively learned using batches of the patches, where the batches are formed by randomly selecting one or more patches from the plurality of patches. In existing techniques, each patch has an equal probability of being selected to form a batch. The resulting dictionary is, generally, a dense matrix, where each column of the matrix is an element of the dictionary, and use of that matrix can be computationally costly during the dictionary learning process as well as when using the learned dictionary to perform sparse coding. Thus, it is desirable to have as few elements within the dictionary as possible (i.e. a smaller matrix), and to reconstruct an image using as few columns of the matrix (i.e. dictionary elements) as possible.

[0079]

[0070] As noted above, each dictionary comprises a plurality of dictionary “elements”, which are often also referred to as “atoms”. The aim of dictionary learning / sparse coding is to find an optimum set of basis vectors (elements / atoms) that enable an input vector to be represented as a linear combination of these basis vectors. (Having one vector or dictionary element for each patch would be inefficient, so the goal is to find a smaller set of basis vectors that can be used to encode the input image. However, the set cannot be too small because that may lead to inaccuracies when encoding the input image. Thus, the optimum set of basis vectors is one which enables inputs to be represented accurately and has a small amount of redundancy). In the context of images, basis vectors / dictionary elements are generated for an input image that has been captured using sparse sampling, and linear combinations of these basis vectors / dictionary elements enable any image to be constructed from the sparse input AL Ref: P46900W01 28 November 2025 image. In some cases, the constructed image may “fill in” or “in-paint” data that was not captured during the sampling / imaging process.

[0080]

[0071] Figure 1 is a schematic diagram showing an overview of dictionary learning, to aid understanding of the present techniques. Dictionary learning involves generating, from an input image 100, a number of potential dictionary elements 102. Two or more of the potential dictionary elements 102 are used in linear combinations to reconstruct the input image 100 (where the input image may be considered the ground truth image). During the dictionary learning process, the accuracy of reconstructions is analysed to determine which dictionary elements are most useful at reconstructing the input image and meet a required accuracy. In Figure 1 , a first subset 104 of dictionary elements are combined in a linear combination to produce a reconstructed image 108. Similarly, a second subset of dictionary elements 106 are combined in a linear combination to produce a reconstructed image 110. The accuracy of each reconstructed image 108, 110 is analysed to determine which of the first subset and second subset of dictionary elements are best at reconstructing the input image 100. In this example, reconstructed image 110 better matches the input image 100 and has a closer similarity to the ground truth image 100, so the first subset of potential dictionary elements 104 may be discarded, and the second subset of dictionary elements 106 may be retained in the dictionary.

[0081]

[0072] Figure 2 is a flowchart of steps of existing techniques to perform dictionary learning and sparse coding. Specifically, Figure 2 shows an unmodified BPFA-EM (beta process factor analysis electron microscope) reconstruction process, which aids understanding of the present techniques. BPFA is a patch-wise algorithm that incorporates sparse coding and dictionary learning. As shown in Figure 2, a standard dictionary learning process involves a step S200 of acquiring a dataset comprising at least one data item. The data item(s) acquired at step S200 could be signals, images or any other type of data that can be encoded using a sparse encoding algorithm. In the following description, the data items are images, merely for ease of discussion. The dataset acquired at step S200 may be a sparse input dataset consisting of data items Y of size Htx Wt.

[0082]

[0073] An image Y from the dataset is first unwrapped into a plurality Npatchof overlapping patches during step S202 (“signal unwrapping”). That is, each input image Y is divided into multiple overlapping patches (where the number of patches is Npatch).

[0083]

[0074] More specifically, the unwrapping process at step S202 involves breaking down an input image Y into overlapping patches of size Hpx Wpresulting in Npatch= Hi - Hp+ AL Ref: P46900W01 28 November 2025

[0084] Wp+ 1) total patches to cover the entire sparse input. The patches can be partitioned into e, subsampling operator and the noise are partitioned as respectively. The patches within the image are sampled with the model can be defined as:

[0085] It is assumed that all the patches from the image Y are sparse in a shared dictionary D e]&(HpxMp)xKof K atoms and sparse weights ate]R xt = Dabfor i e {1, ... , Npatch] (2)

[0086] The three other assumptions for BPFA are that: (i) all of the dictionary atoms in D ^HpylvpfKare drawn from a zero-mean multivariate Gaussian distribution; (ii) both the components of the noise vectors n and the non-zero components of the sparse weight vectors are drawn i.i.d. from zero-mean Gaussian distributions; and (iii) the sparsity prior on the weight vectors is promoted by the Beta-Bernoulli process. This gives the hierarchical model for BPFA as for all patches i e {1, ..., Npatch} and dictionary atoms k e {1, is the identity matrix with dimensions K x K, ° denotes the Hadamard product, and the variables a and b are input parameters of the beta-process. ztin equation 3.4 is a binary vector that controls the dictionary atoms used to represent xbnkdenotes the probability of using a given dictionary atom dKfor reconstructing. The variables ynand yware the precision parameters. All the unknown parameters in the hierarchical model above are inferred using Expectation Maximisation (EM) AL Ref: P46900W01 28 November 2025 inference.

[0087]

[0075] In order to learn a dictionary, as shown in Figure 2, a sparse coding step S206 is performed. Learning the dictionary involves an iterative process that uses batches of the image patches, where the batches are formed by randomly selecting one or more patches from the plurality of patches. Thus, the input into the sparse coding step S206 comprises selected patches from the patches generated during step S202.

[0088]

[0076] Finding a sparse coding for a given dictionary involves applying a sparse coding algorithm to the dictionary.

[0089]

[0077] The sparse coding step S206 is now explained in more detail. As shown in Figure 2, in addition to the selected patches, another input into the sparse coding step S206 is a candidate or initial dictionary S204. As mentioned above, sparse coding algorithms are used to transform a sparse representation of data (e.g. a noisy image, or an image captured using sparse sampling) into an original, non-sparse representation of the data (e.g. an original image, or an image that is not captured using sparse sampling). Thus, a sparse coding algorithm is trained, using a dataset and a dictionary (or candidate / initial dictionary), to find the optimal number of non-zero dictionary elements to enable the transformation. In other words, sparse coding is used to find a succinct linear combination of dictionary elements, such that, in the linear combination only a small number of non-zero dictionary elements are needed to approximate the original image. The output of the sparse coding step S206 is a “weight” matrix of sparse representations which can be used to reconstruct an image and, when done correctly can produce a denoised image. In Figure 2, the step S206 of sparse coding involves computing abatchand extracting rows of abatchintoaglobal a matrix.

[0090]

[0078] One example sparse coding algorithm is k-SVD (a k-means clustering based singular value decomposition approach). K-SVD involves fixing the dictionary and then finding the best sparse coding for the dictionary. Without getting into the specifics of the well-known mathematics of k-SVD, the process involves performing a rank-1 approximate of a residual matrix (step S208 of “calculate residual” in Figure 2), updating the dictionary elements using the residual matrix (step S210 of “update dictionary” in Figure 2), and enforcing some sparsity after the update. The step S208 of calculating a residual may comprise computing = Dt-iabatch and ?6atcft= <t> batch Ybatch - Xbatch - The step S210 of updating the dictionary may comprise solving and calculating Dt= (1 - pt)Dt-1+ ptD . Then the following values are updated according to ptto generate, at step S212, the updated dictionary Dy. y£, AL Ref: P46900W01 28 November 2025 ydand fl. The resulting dictionary is the used to reconstruct the original image (step S214 of “signal wrapping” in Figure 2). The step S214 of signal wrapping comprises forming an estimate X = Dta and wrapping this solution into shape M. The solution, i.e. the reconstruction of the original image that is output at step S216, is then rewritten in the form of a matrix M, where each column is an element of the dictionary used to form the reconstruction. The steps S202 to S216 are repeated using the other images in the input dataset, where the updated dictionary from each iteration (Dt, output at step S212) is used as the initial starting point at step S204 for the sparse coding step S206 for the subsequent iteration. (That is, for iteration t, the dictionary from iteration t-1 is used).

[0091]

[0079] It is clear from Figures 1 and 2 that in existing techniques, each patch has an equal probability of being selected during the sparse coding step S206 to form a batch, where the batch is used to learn dictionary elements. However, this can be problematic because different characteristics of an image are not usually equally distributed across an image. For example, consider an image that has 10 x 10 pixels, one of which is white and all the rest are black. In this example, if patches are single pixels, and the white pixel is selected and used to generate a dictionary element, the dictionary element would not be very useful at constructing 99% of the pixels in the image. That is because the white pixel is a very rare characteristic or feature of the image. Similarly, consider an image that has 10 x 10 pixels, and shows a book on a table. Much of the image shows the table surface or the book surface, which means large chunks of the image could be constructed from a few dictionary elements. The interesting features of the image are at the boundary between the table and book - these features are rare within the image. If patches were randomly selected and happened to all contain the boundary, the resulting dictionary elements may not help reconstruct the table or the book very well. Similarly, if patches were randomly selected and happened to contain book or table, the resulting dictionary elements may not help reconstruct the boundary very well.

[0092]

[0080] Figure 3A shows an input image, which is also referred to herein as a ground truth image. The input may be sparsely sampled, such that the reconstruction of the input image is based on having sparse data as the starting point. Figure 3B shows a reconstruction of the input image, where the reconstruction is generated via a standard sparse-coding algorithm (specifically BPFA), and where each patch is equally likely to be selected and contribute to the formation of a dictionary. It is clear that the reconstruction contains blurring. The origin of this blurring can be attributed to the compressed representation of the signal effectively “blocking” the highest spatial resolution frequencies being strongly represented in the final reconstruction. Although the highest spatial resolution frequencies may be present in the AL Ref: P46900W01 28 November 2025 dictionary elements, these dictionary elements are not used as often or with a high enough frequency to fully transfer the intrinsic resolution in the sparsely sampled acquisition to the final reconstruction.

[0093]

[0081] To enhance the interpretability and performance of the learned dictionary, the present techniques utilise a post-processing step to reorder and cluster dictionary atoms D based on the frequency fdof their usage throughout the entire reconstruction, by summing the amount of times a dictionary atom’s sparse weights are non-zero with fd= ^^tch(at 0), as well as how important they were to calculate the estimate Y for each individual patch N. This is done for each dictionary atom. This is performed in addition to the sparse weighting a, during the sparse coding step of BPFA, where each dictionary atom receives an index that estimates its signal frequency fNfor each patch. This provides a measurement of how important that dictionary atom is for forming the estimate on that patch. With this, it is possible to generate a scores metric S for each atom, where for each dictionary atom:

[0094] S = efdi, for i e [l, ...,Npatcll} (4)

[0095]

[0082] This scores metric is then normalized, and clustering allows for selective activation or additional weighting of dictionary atoms based on the structural features of interest within the sample. For example, the structural features of interest may be those which emphasize lattice fringes or crystalline orientations. Higher-frequency dictionary groups can be preferentially retained or strengthened during the reconstruction step.

[0096]

[0083] Figures 4A and 4B show two reconstructions of an input image (the image in Figure 3A) generated by re-weighting a weight matrix in two different, but arbitrary, ways. Specifically, Figure 4A is generated by using a weight matrix that has been re-weighted to prioritise feature values (i.e. image pixel intensities or contrast), while Figure 4B is generated by using the same weight matrix but which has been re-weighted to prioritise feature sharpness (i.e. how well- defined boundaries around features are within the image, or the resolution of features). It can be seen that the image in Figure 4A shows different features of the image clearly, while the image in Figure 4B shows boundaries of features clearly. These images show the impact of the dictionaries in which dictionary elements are weighted based on features of interest.

[0097]

[0084] Figure 5A shows a normally generated dictionary that was initialized randomly and converged with the update dictionary step shown in Figure 2. Here, the dictionary consists of AL Ref: P46900W01 28 November 2025

[0098] 40 atoms or dictionary elements. In contrast, Figure 5B shows a ranked dictionary based on the normally generated dictionary (Figure 5A) being sorted based on the scores S metric being calculated for each dictionary atom / element.

[0099]

[0085] The present techniques, which involve preferentially selecting patches, are now explained in more detail.

[0100]

[0086] (i) Separation or classification of sub-regions in an image or signal using known or estimated dictionary element frequency.

[0101]

[0087] Technique (i) involves making use of a known or estimated frequency of each dictionary element. The known or estimated frequency is used at two stages of the process to perform dictionary learning and sparse coding. Firstly, the frequency of each dictionary element is estimated during the dictionary learning and sparse coding step. Secondly, the impact of each dictionary element on the reconstruction can be adjusted, to preferentially boost certain characteristics of the image (e.g. higher spatial frequency features over background features). Thus, technique (i) involves estimating the frequency of dictionary elements throughout the dictionary learning and sparse coding process. Due to the nature of the way greedy sparse- coding methods select dictionary elements (known as a “support”) to find the succinct linear combination of dictionary elements to reconstruct the input image, the order in which elements are chosen from the dictionary provides a valuable measurement of the frequency of features present in the respective dictionary elements.

[0102]

[0088] Figure 5C is a flowchart of example steps of technique (i) to perform dictionary learning and sparse coding, which involves reconstructing an input image or data item by using support order based frequency separation of dictionary elements. Use of the known or estimated frequency of each dictionary element at two stages of the process is also explained.

[0103]

[0089] As shown in Figure 5C, the process follows on from step S200 and S202. Thus, the present techniques comprise acquiring an input dataset comprising a plurality of data items (c.f. step S200 in Figure 2). The data items could be signals, images or any other type of data that can be encoded using a sparse encoding algorithm. In the following description, the data items are images, merely for ease of discussion.

[0104]

[0090] An image from the input dataset is first unwrapped into a plurality of patches (step S202 in Figure 2). AL Ref: P46900W01 28 November 2025

[0105]

[0091] As explained above, the sparse coding step S206 ordinarily involves randomly selecting one or more patches from the plurality of patches generated during step S202. However, in the present techniques, step S206 is implemented using the method shown in Figure 5CSpecifically, sparse coding involves computing abatchand extracting rows of «batch into aglobal a matrix. As explained below, this involves utilising support order (element selection) indexes to estimate the signal frequency of each dictionary element. This enables the clustering of elements (allowing the arbitrary frequency-separation of features in the reconstruction), or the classifying of subregion solutions (e.g. as foreground / background).

[0106]

[0092] As shown in Figure 5C, instead of performing step S206 in Figure 2 by randomly selecting patches, the present techniques comprise selecting a subset of patches from the plurality of patches using at least one predefined criterion.

[0107]

[0093] For example, at step S500 in Figure 5C, selecting a subset of patches may comprise determining a value of at least one predefined criterion for each patch of the plurality of patches. Then, the method comprises selecting a subset of patches based on the determine value (step S502).

[0108]

[0094] That is, the present techniques propose that the sampling of the patch space should be modified from the existing techniques, so that certain patches are more likely or less likely to be selected. In other words, the present techniques propose changing the probability of selection of the patches, so that some patches may have a higher probability of being selected and some patches may have a lower probability of being selected. The probability may be associated with how common or rare the information within a patch is in the context of the whole image. The dictionary elements can be learned to preferentially enhance certain components or features within the input image, such as high frequency components.

[0109]

[0095] A dictionary is then iteratively learned using batches of the patches. However, compared to Figure 2 where the batches are formed by randomly selecting one or more patches from the plurality of patches, in the present techniques, certain patches are more or less likely to be selected based on some criteria. That is, instead of randomly selecting the patches that are then used to form the dictionary, the patches are selected based on at least one predefined criterion. AL Ref: P46900W01 28 November 2025

[0110]

[0096] In one example, some pre-processing of the image from the dataset may be performed to determine or estimate the signal frequencies represented by each patch of the image, which is used to determine the likelihood of usage at step S500. Then, at step S502, patches having certain frequencies can be purposefully selected and used to generate a dictionary. This ensures that the dictionary contains dictionary elements that are, for example, more likely to be used frequently in a reconstruction of the input image. The pre-processing (not shown in Figure 5C) may be performed manually by a human or may be automated.

[0111]

[0097] As noted above, the probability of selection may be decided using at least one predefined criterion. For example, the at least one predefined criterion may be any one or more of: a data value of each patch; a darkness value of each patch; a brightness value of each patch; a standard deviation from the pixel intensity values within each patch; a gradient with respect to rows and columns of pixels within each patch; and a spatial frequency value of each patch. The probability of selection may be implemented using a probability matrix associated with the plurality of patches, where the probability matrix determines the likelihood of selection. In other words, determining a value of at least one predefined criterion for each patch (step S500) may involve generating a probability matrix, which is then used to perform the selecting at step S502. A single matrix is associated with I represents the plurality of patches. The values / elements of the probability matrix may be based upon the at least one predefined criterion. The values / elements of the probability matrix may be inferred from an arbitrary selection of patches (i.e. some pre-defined patches or values, which may be randomly selected or based on some criterion / criteria being met, etc), or may be inferred by using a machine learning, ML, model that is trained to select the optimal patches, previous sparse-coding residuals (from a previous sparse coding of a similar signal or data, or similar). For example, the previous sparse-coding residuals may be generated for a similar electromagnetic sample and / or a signal with similar noise or similar frequency resolution. Then, as shown in Figure 5C, the process continues back to step S208 in Figure 2 and the updated dictionary is generated based on the purposeful I non-random selection of the patches.

[0112]

[0098] In an alternative example, the dictionary may be generated using randomly selected patches (as per step S206 in Figure 2), but the dictionary that is updated at step S210 may then be adjusted based on how often each dictionary element is estimated to be used in a reconstruction of the input image. The estimation is performed within the sparse coding step of the method, and is based on how frequently each dictionary element is selected and used in a reconstruction. That is, determining a value of at least one predefined criterion for each AL Ref: P46900W01 28 November 2025 patch (step S500) may involve estimating, for each patch, a likelihood that a dictionary element generated from the patch will be used to reconstruct the patch. The estimated likelihood or frequency of use of each dictionary element may be used to cluster the dictionary elements into a plurality of clusters, where each cluster comprises dictionary elements that are estimated to be used the same or a similar number of times in a reconstruction. Alternatively, the clusters may represent different regions of the input image (e.g. background, foreground, etc.) In either case, the clustering may be used to cull some dictionary elements from the dictionary, so that the dictionary contains, for example, dictionary elements that are more likely to be used frequently in a reconstruction of the input image. With respect to each cluster, one or more dictionary elements within each cluster may be discarded / culled. For example, if two or more dictionary elements within a cluster are similar, only one of these may be retained. In some cases, whole clusters may be discarded - this may occur if the dictionary elements within a cluster have a very low estimated frequency of use or are estimated to never be used.

[0113]

[0099] In this alternative example, after step S500 has been performed, the process continues back to step S208 in Figure 2 and the updated dictionary is generated based on the purposeful I non-random selection of the patches. The resulting dictionary is the used to reconstruct the original image (“signal wrapping” step S214). However, here, the known or estimated frequency of use of each dictionary element is utilised again. The frequency of use is used to adjust weights of each dictionary element (i.e. the dictionary, which, after sparse coding, may be considered a weighted dictionary). By manipulating individual elements, rows or columns of the dictionary, it is possible to change the effect that different dictionary elements have on the reconstruction of the data. More specifically, in this example of the present techniques, the signal wrapping step S214 comprises modifying coefficients of the solution according to classification, or the (e.g. clustered) frequency of elements in the solution. This has the effect of preferentially boosting a target (e.g. higher frequency) signal relative to other signals (e.g. background / noise). The subregion solutions can be recombined with biases, according to a number of different potential methods. The wrapped signal can be used to enhance the resolution of the final reconstruction and provide improvement.

[0114]

[0100] The adjustment of the weights (or “re-weighting”) during step S214 may be done in several ways. For example, a neural network may be used to re-weight the dictionary, or a band-pass style filter may be applied to the dictionary matrix to filter out or re-weight certain elements of the dictionary. AL Ref: P46900W01 28 November 2025

[0115]

[0101] In another technique, the re-weighting of the dictionary during step S214 may be done to prioritise feature values, specifically higher-frequency features. For example, the clustering of the dictionary elements by their frequency or their classification (which was performed during the sparse coding step), may also be utilised at this stage to re-weight the dictionary.

[0116]

[0102] The reweighted dictionary is then used to form the solution, i.e. the reconstruction of the original image (step S216), and this is then rewritten in the form of a matrix M, where each column is an element of the dictionary used to form the reconstruction. The steps in Figures 2 and Figure 5C are repeated using the other images in the dataset, where the updated dictionary from each iteration (Dt) is used as the initial starting point for the sparse coding step for the subsequent iteration. (That is, for iteration t, the dictionary from iteration t-1 is used).

[0117]

[0103] Figure 6 shows the impact of present technique (i) (i.e. the process shown in Figure 5C) on a reconstruction. To evaluate the impact of the present techniques, experiments were conducted by imaging gold nanoparticles. The original reference images depict a gold polycrystalline nanoparticle sample, and were captured using a JEOL GrandARM2. All the reconstruction and enhancement procedures were implemented in Python using NumPy, OpenCV and H5Py. BPFA was based on the implementation described in Sertoglu and Paisley (S. Sertoglu and J. Paisley, "Scalable Bayesian nonparametric dictionary learning," 2015 23rd European Signal Processing Conference (EUSIPCO), Nice, France, 2015, pp. 2771-2775), with modifications to allow user-defined parameters for learning and reconstruction within Python. Visualization and Fourier analyses were conducted using Matplotlib and Imaged. To emulate a subsampling experiment to test the present techniques, a sub-sampling mask was applied prior to BPFA. Rather than every pixel being available, a randomized pixel mask was used to reconstruct from only a fraction of the total available pixels in the image (around 25%).

[0118]

[0104] In Figure 6, the top row of images shows, on the left, an original, reference input image, which is also referred to as the ground truth. The centre image is a generic reconstruction of the ground truth image that is generated by performing a sparse sampling of the ground truth image, that uses 25% of the total pixels within the ground truth image. Thus, the reconstruction is formed using only 25% of the pixels of the ground truth image. The right image is a reconstruction using the same ground truth image and the present technique described in Figure 5C. As explained above, the present techniques separate the reconstruction into separate layers based on their “frequencies”, and recombine these to visualise the features of interest. The bottom row shows corresponding Fast Fourier Transforms, FFT, for the AL Ref: P46900W01 28 November 2025 corresponding image in the top row. It can be seen from Figure 6, particularly the bottom row, that the technique described in Figure 5C leads to an increase in discernible patterns in frequency space.

[0119]

[0105] Figures 7A to 7C show, respectively, an original image, a first reconstruction using a weight matrix, and a second reconstruction using a re-weighted version of the weight matrix used for the first reconstruction. The original image of Figure 7A is the same image as in Figure 4A and Figure 3A. The first reconstruction of Figure 7B is the same as the reconstruction of Figure 4A. Figures 8A to 8C show a zoomed-in view of the same section of the images in Figures 7A to 7C

[0120]

[0106] The second reconstruction of Figure 7C is generated by re-weighting a weight matrix (specifically, the weight matrix used in the first reconstruction) to prioritise feature values, specifically higher-frequency features. Figure 7C is an example of a technique to perform dictionary element clustering based on the support-order, where the frequency of dictionary elements is estimated throughout the sparse-coding process. Due to the nature of the way greedy sparse-coding methods form their support (selection of dictionary elements), the order in which elements are chosen across the global solution provides a valuable measurement of the frequency of features present in the respective dictionary elements.

[0121]

[0107] (ii) Reconstructing an image or signal by combining individual reconstructions produced using multiple dictionaries.

[0122]

[0108] Technique (ii) involves realising that different dictionary learning algorithms have their own advantages and disadvantages, and that it may be advantageous to form a dictionary having dictionary elements generated by different algorithms.

[0123]

[0109] A single dictionary may, via iterative methods, be generated from multiple algorithms operating a shared dataset and shared dictionary. That is, generating a plurality of potential dictionary elements for the dictionary may comprise using two or more dictionary learning algorithms.

[0124]

[0110] In other words, an arbitrary number of dictionaries may be learned (via any dictionary learning algorithm) on the same dataset. The resulting dictionaries may be combined in a number of different ways to enhance the final reconstruction. AL Ref: P46900W01 28 November 2025

[0125]

[0111] For example, a single dictionary may be learned from one (or more) image(s) using both K-SVD and BPFA, two common dictionary learning algorithms, both of which have different sets of benefits and limitations.

[0126]

[0112] In another example, a single dictionary may be learned by applying different dictionary learning algorithms to different regions of the images in the dataset. The different regions may be, for example, foreground and background.

[0127]

[0113] In another example, a single dictionary may be learned by applying different dictionary learning algorithms to the images in the dataset, and then utilising the lowest residual error for each dictionary as the preferred solution for any given subregion of the images.

[0128]

[0114] Using multiple algorithms to generate a single dictionary may have a number of advantages. For example, the benefits of each algorithm may be utilised simultaneously. Different sparse coding algorithms have different efficacies and prioritise different image features.

[0129]

[0115] Thus, technique (ii) may enable a smooth transition between two (or more) dictionary learning algorithms that results in a single, higher quality dictionary being generated compared with the individual dictionaries produced by each dictionary learning algorithm separately.

[0130]

[0116] Each algorithm of the multiple algorithms may be associated with a dictionary specific to that algorithm. Instead of combining the dictionary elements to form an average or combined dictionary, the dictionary elements for each algorithm may be applied to different sections of an image to reconstruct the image. That is, the algorithms may be better at processing different parts of the image.

[0131]

[0117] Figure 9 is a flowchart of example steps of technique (ii) to perform dictionary learning and sparse coding, using multiple dictionary learning algorithms.

[0132]

[0118] As shown in Figure 9, the present techniques comprise, at step S900, acquiring a dataset comprising a plurality of data items (c.f. step S200 in Figure 2). The data items could be signals, images or any other type of data that can be encoded using a sparse encoding algorithm. In the following description, the data items are images, merely for ease of discussion. AL Ref: P46900W01 28 November 2025

[0133]

[0119] An image from the dataset is first unwrapped into a plurality of patches (step S902, “signal unwrapping”). Here, compared to Figure 2 or Figure 5C, the image may be processed to identify and classify subregions of the image (or, more generally, to identify and classify different characteristics, features or components of a signal or data item). The process may involve determining how frequent each subregion is within the image. Any method of subregion frequency classification may be used, such as DCT sparse-coding, or support order frequency estimation. The subregions may be, for example, background and foreground.

[0134]

[0120] A dictionary is then iteratively learned using selected batches of the patches (“sparse code”, step S906). This step involves computing cratchar|d extracting rows of cratch int° a global a matrix. The patches may be selected using the techniques described above with respect to Figure 5C. As shown in Figure 9, an input into the sparse coding step S906 is multiple candidate or initial dictionaries (step S904). The first iteration may involve starting from a single candidate / initial dictionary and, as explained below, may result in multiple updated dictionaries by virtue of applying different dictionary learning algorithms. Alternatively, the first iteration may involve starting from multiple initial dictionaries.

[0135]

[0121] To learn the dictionary, in some cases, multiple dictionary learning algorithms may be applied to all subregions of the image. That is, generating a plurality of potential dictionary elements for the dictionary may comprise using two or more dictionary learning algorithms, and then, for example, utilising the lowest residual error for each dictionary as the preferred solution for any given subregion of the images.

[0136]

[0122] Alternatively, in other cases, different dictionary learning algorithms may be applied to different regions of the images in the dataset, so that separate algorithms are trained to, and then used to, reconstruct different regions of an image. The different regions may be, for example, foreground and background. Then, the dictionary elements for each region are combined to form a single dictionary.

[0137]

[0123] The steps to calculate a residual (step S908) are the same in Figure 9 as in Figure 2 and therefore, are not explained again. However, this time, multiple dictionaries are generated, , ... , D during each iteration (step S910, which are output at step S912).

[0138]

[0124] The resulting dictionaries are then used to reconstruct the original image (step S914, “signal wrapping” in Figure 9). The step involves forming an estimate X = Dta and wrapping this solution into shape M. In essence, dictionary elements from any of the multiple AL Ref: P46900W01 28 November 2025 dictionaries may be used in the way described above. Thus, in the scenario where multiple dictionaries are available, it is possible to generate a reconstruction of an image by using a weighted combination of multiple dictionary sources. For any two patches of an image, there may not be a single dictionary that can appropriately represent both patches. Therefore, it is beneficial to have multiple dictionaries to draw from, but also to be able to weight the use of each dictionary based on some criteria.

[0139]

[0125] For example, one way to weight use of each dictionary may comprise limiting and weighting the selection of a dictionary to reconstruct a specific target patch based on a residual of the target patch and elements of each dictionary. This would in effect allow the selection of the highest quality outputs of the sparse coding process from all the dictionary sources available.

[0140]

[0126] An extension of this weighting process may involve using multiple dictionaries with differing parameters, particularly the shape of the dictionary elements. This would allow for the generating of dictionaries with varying feature sizes, where at least one dictionary may result in an improved individual (local) estimate for missing pixels in an image reconstruction.

[0141]

[0127] Similarly, weighting between these dictionaries allows for the most appropriate feature size to be preferentially selected in differing regions of the image.

[0142]

[0128] The solution, i.e. the reconstruction of the original image (as output at step S916), is then rewritten in the form of a matrix M, where each column is an element of the dictionary used to form the reconstruction. The steps S902 to S916 are repeated using the other images in the dataset, where each updated dictionary from each iteration (0^) is used as the initial starting point for the sparse coding step for the subsequent iteration. (That is, for iteration t, each dictionary from iteration t-1 is used).

[0143]

[0129] (iii) Classified Subregion (re-)Normalisation.

[0144]

[0130] When determining the estimated value of an individual pixel in the reconstruction (which is affected by the results of many sparse coding processes, even when using a single dictionary), a further weighting method may be applied, factoring in information such as the location of the given patch for each local estimate, or a combination of any of the previously mentioned options such as various dictionaries. This allows for the reconstruction to be AL Ref: P46900W01 28 November 2025 optimised on a pixel-by-pixel basis to preferentially reconstruct the highest frequency or most accurate information, reducing blurring and / or the residual error, respectively.

[0145]

[0131] Technique (iii) takes advantage of the above-described methods for subregion classification. The subregion classification may be performed by using support-order methods with a sparse-coding algorithm (such as BPFA), or by using a dictionary with a known frequency basis such as DCT. After classifying regions of an image from a dataset as, for example, a background region or a foreground region, the set of targeted subregions (usually foreground) are normalised per-subregion. This then becomes the input into a (potentially second) sparse-coding / dictionary learning process. This promotes improved dictionary learning and resolution of features. Upon recombination of subregions, target regions may be re-scaled according to the input, whilst retaining improved resolution.

[0146]

[0132] In other words, technique (iii) includes a preprocessing step to enhance visual clarity of high frequency features in the sub-sampled patches. With the usage of a known discrete cosine transform (DCT) dictionary DDCT, the sparse coding step is performed on a given input Y to determine the sparse weights a calculated for each dictionary element. Using these sparse weights and the known frequency of the dictionary elements, a thresholding is performed on the reconstruction Y to determine a binary mask B, which can be used to separate Y into a foreground YFand background YBsignal, where:

[0147] Y = YF+ YB(5)

[0148] Each image patch in the foreground YFis then normalised to form |TF|, using:

[0149] The total normalised foreground |TF| is then recombined with the background YBto form a new input YN, using YN= |TF| + YB, to calculate the estimate YN. This makes key features more distinguishable within each patch, to aid the BFPA algorithm in learning the dictionary.

[0150] Within the estimate YN, the patches that constitute YFare then rescaled to original bounds on the same patch-wise basis to remove the difference in contrast between YFand YBcaused by foreground self-normalisation step. AL Ref: P46900W01 28 November 2025

[0151] YFi= (max(yF- min(yF) x YNi+ mm(YFi) ,for i e {1, ...,Npatcll} (7)

[0152] Then YFis recombined with YBto obtain the final reconstruction, inal= YF+ Yb(8)

[0153] Thresholding parameters are tuned to avoid amplifying noise while increasing local structural clarity, particularly for weakly scattering features such as isolated elements on low-contrast backgrounds.

[0154]

[0133] In other words, technique (iii) comprises the following steps: i. Perform BPFA sparse coding with DCT on input image; ii. Perform thresholding using calculated weights; iii. Normalise separated foreground on a patch-wise basis; iv. Recombine altered foreground with the original background; v. Perform BPFA on exaggerated input; vi. Revert normalisation on the output.

[0155] These additional steps are now explained in more detail below with reference to Figure 10.

[0156]

[0134] Figure 10 is a flowchart of example steps of technique (iii) to perform dictionary learning and sparse coding, using classified subregion (re)normalisation to improve signal recovery.

[0157]

[0135] As shown in Figure 10, the present techniques comprise acquiring a dataset comprising a plurality of data items (c.f. step S200 in Figure 2). The data items could be signals, images or any other type of data that can be encoded using a sparse encoding algorithm. In the following description, the data items are images, merely for ease of discussion.

[0158]

[0136] An image from the dataset is first unwrapped into a plurality of patches (step S202, “signal unwrapping”). However, , instead of simply dividing the image into a plurality of patches and then inputting these into the sparse coding step, the image is processed to identify and classify subregions of the image (or, more generally, to identify and classify different characteristics, features or components of a signal or data item), prior to performing the sparse coding. A subregion may be the background of the image or the foreground of the image, for example. The pre-processing may involve determining how frequent each subregion is within the image. Any method of subregion frequency classification may be used, AL Ref: P46900W01 28 November 2025 such as DCT sparse-coding, or support order frequency estimation. The subregions may be, for example, background and foreground. Subregions of interest (typically foreground) may be normalised to exaggerate features of the image (or signal or data item).

[0159]

[0137] Specifically, as shown in Figure 10, after the image has been divided into patches, the frequency of features in each patch within the image is determined (step S1000). The goal, as noted above, is to enhance the visual clarity of high frequency features in patches which are sampled during the sparse coding step, and so knowing the frequency of the features is necessary. Then, the whole image (or each individual patch) is divided into two or more separate components (step S1002). For example, the image (or each patch) may be divided into background and foreground. For each patch, one of the components is normalised prior to recombination with the other component(s) (step S1004), as per Equation 6 above. Once this occurred, the sampling of patches can occur - as shown in Figure 10, the process returns to step S204 of Figure 2.

[0160]

[0138] The patches may be selected (step S206) using the techniques described above with respect to Figure 5C. Similarly, multiple dictionary learning algorithms may be applied, as described above with respect to Figure 9.

[0161]

[0139] When the dictionary is updated (step S210, “update dictionary” in Figure 2), the exaggerated features in the patches lead to an improvement in the dictionary learning process, as they are better able to represent high frequency details or features with reduced contrast. Exaggerated features are those with improved intensity and contrast in regions of interest.

[0162]

[0140] As shown in Figure 10, the resulting dictionary is then used to reconstruct the original image via a signal wrapping step. However, instead of performing signal wrapping as described above with reference to Figure 2, the signal wrapping here may comprise renormalising subregions / features in the patches (step S1006). That is, upon or prior to combination of dictionary elements, each subregion of the image may be renormalised back to the correct scale as determined by the subregions of the input image from the dataset, whilst still retaining the enhanced resolution of the features. That is, once a reconstruction has been generated, the subregions that had previously been ‘normalized’ are ‘denormalized’ to return to the images original intensity scaling. It is possible to store the local maxima and minima after the normalising of the subregions, so that they can be used to renormalise the images to the correct scale. AL Ref: P46900W01 28 November 2025

[0163]

[0141] The solution, i.e. the reconstruction of the original image, is then rewritten in the form of a matrix M, where each column is an element of the dictionary used to form the reconstruction. As explained above, the steps are repeated using the other images in the dataset, where the updated dictionary from each iteration (Dt) is used as the initial starting point for the sparse coding step for the subsequent iteration. (That is, for iteration t, the dictionary from iteration t-

[0164] I is used).

[0165]

[0142] Figure 11 shows the impact of present technique (iii) (i.e. the process shown in Figure 10) on a reconstruction. In Figure 11 , the left image on the top row shows an original, reference input image of gold nanoparticles (same as in Figure 6). The centre image on the top row is a reconstruction of the sparsely sampled ground truth / reference input image (25% subsampled) (same as in Figure 6), where the reconstruction uses the generic BPFA. The right image on the top row is a reconstruction of the ground truth / reference input image which is sparsely sampled (25%) using the technique shown in Figure 10, where the input is enhanced through patch-wise normalisation. The large boxes in the top right of each image is a zoomed-in view of the smaller boxes. The bottom row shows corresponding Fast Fourier T ransforms, FFT, for the corresponding image in the top row. Thus, it can be seen from Figure

[0166] I I that the present techniques lead to a difference / improvement in contrast and feature definition in reconstructed images. Aside from the improved visibility of lattices and atoms within the large particles, the present techniques also enable observation of atoms around these large particles, which would otherwise not be visible due to the noise of the reconstruction, or even the contrast of the fully sampled image.

[0167]

[0143] (iv) Reconstructing an image or signal by selectively reconstructing certain subregions.

[0168]

[0144] Technique (iv) comprises using any of the above-described methods for subregion selection / classification and further adapting the reconstruction process to preferentially (or exclusively) select subregions during the signal unwrapping / extraction stage, such that the inpainting process focuses on these target regions. This can provide faster / more efficient reconstructions, or reconstructions of improved quality of the intended regions, whilst spending less time on the task of reconstructing background (or other less relevant) information.

[0169]

[0145] Figure 12 is a flowchart of example steps of technique (iv) to perform dictionary learning and sparse coding, by focusing on certain subregions of the images of the training dataset. AL Ref: P46900W01 28 November 2025

[0170]

[0146] As shown in Figure 12, the present technique (iv) comprises acquiring a dataset comprising a plurality of data items (c.f. step S200 in Figure 2). The data items could be signals, images or any other type of data that can be encoded using a sparse encoding algorithm. In the following description, the data items are images, merely for ease of discussion.

[0171]

[0147] An image from the training dataset is first unwrapped into a plurality of patches (step S202, “signal unwrapping”). However, it is desirable to select patches from more relevant subregions of the image. For example, the foreground of the image may contain more useful information for the dictionary than the background of the image, and so it may be useful for more patches to be selected from the foreground.

[0172]

[0148] Thus, the process involves performing some additional processing prior to, or during, the sparse coding step S206. As shown in Figure 12, the image may be processed to identify and classify subregions of the image (or, more generally, to identify and classify different characteristics, features or components of a signal or data item) (step S1200). The process may involve determining how frequent each subregion is within the image (step S1202). Any method of subregion frequency classification may be used, such as DCT sparse-coding, or support order frequency estimation. The subregions may be, for example, background and foreground.

[0173]

[0149] The sparse coding step then involves selecting the patches. The patches may be primarily or exclusively from subregions of interest (such as subregions classified as foreground) (step S1204). The process then returns to step S208 in Figure 2.

[0174]

[0150] Figure 13 shows the impact of present technique (iv) (i.e. the process shown in Figure 12) on a reconstruction. Figure 13 shows an illustration of how to perform targeted inpainting or target reconstruction of certain subregions of interest. As noted above, it is possible to preferentially select subregions of an image to reconstruct. Specifically, Figure 13 shows how subregion selection using foreground classification achieves preferential inpainting of strategically selected subregions. The Figure shows (left) random patch selection from an image in a first pass, (centre) separation of the foreground and background based on the first pass (i.e. binary classification of the foreground subregions of the image, shown in white), and (right) preferential selection of patches from certain subregions, specifically those classified as foreground subregions. That is, the right image shows the patches to be operated on using AL Ref: P46900W01 28 November 2025

[0175] BPFA in the next pass, after separating the foreground and background subregions of the image.

[0176]

[0151] Figure 14 is a flowchart of example steps of a computer-implemented method for generating a sparse dictionary for reconstructing images. The method comprises: obtaining a dataset comprising at least one image (step S1400). This step may comprise obtaining at least one image captured by a microscope or other imaging device. In some cases, the image may be acquired using a sparse imaging / acquisition process, such that the present techniques may be used to reconstruct the image using sparse data. Sparse imaging processes may speed-up the imaging process, and when combined with the present techniques, a reconstruction that is nearly as good as an image obtained by a complete / non-sparse acquisition process.

[0177]

[0152] For each image in the dataset, the method comprises converting the image into a plurality of patches (step S1402). This is described above with respect to Figure 2 (“signal unwrapping”).

[0178]

[0153] The method comprises selecting a subset of patches from the plurality of patches using at least one predefined criterion (step S1404). The subset of patches may be selected in a number of ways.

[0179]

[0154] For example, at step S1404, selecting a subset of patches using at least one predefined criterion may comprise: estimating, for each patch, a likelihood that a dictionary element generated from the patch will be used to reconstruct the patch. That is, it may be possible to determine whether a dictionary element created from a patch is likely to be used to reconstruct the patch. If the dictionary element is highly likely to be used it will be assigned a higher likelihood value than a dictionary element that is unlikely to be used or not used at all. This is described above with respect to Figure 5C.

[0180]

[0155] In another example, at step S1404, selecting a subset of patches using at least one predefined criterion may comprise using any one or more of: a data value of each patch; a darkness value of each patch; a brightness value of each patch; a standard deviation of each patch; a gradient of each patch; and a spatial frequency value of each patch. It will be understood that these are some non-limiting and non-exhaustive example criteria. AL Ref: P46900W01 28 November 2025

[0181]

[0156] The method comprises generating a dictionary by: generating a plurality of potential dictionary elements from the selected subset of patches using a dictionary learning algorithm (step S1406). A single dictionary may be generated using a single dictionary learning algorithm, as described above with respect to Figure 5C. Alternatively, a single dictionary may be generated using multiple dictionary learning algorithms, as described above with respect to Figure 9.

[0182]

[0157] The method comprises reconstructing the image using two or more dictionary elements in a linear combination (step S1408). This is described above with respect to Figures 2 (step S216, “reconstruction”).

[0183]

[0158] The method comprises retaining, in the dictionary, the potential dictionary elements that are used to reconstruct the image (step S1410). This is described above with respect to Figure 5C.

[0184]

[0159] It will be understood that any or all of the techniques described with respect to Figures 5C, 9, 10 and 12 may be combined.

[0185]

[0160] Those skilled in the art will appreciate that while the foregoing has described what is considered to be the best mode and where appropriate other modes of performing present techniques, the present techniques should not be limited to the specific configurations and methods disclosed in this description of the preferred embodiment. Those skilled in the art will recognise that present techniques have a broad range of applications, and that the embodiments may take a wide range of modifications without departing from any inventive concept as defined in the appended claims.

Claims

AL Ref: P46900W01 28 November 2025CLAIMS1. A computer-implemented method for generating a sparse dictionary for reconstructing images, the method comprising: obtaining a dataset comprising at least one image; for each image in the dataset: converting the image into a plurality of patches; selecting a subset of patches from the plurality of patches using at least one predefined criterion; and generating a dictionary by: generating a plurality of potential dictionary elements from the selected subset of patches using a dictionary learning algorithm; reconstructing the image using two or more dictionary elements in a linear combination; and retaining, in the dictionary, the potential dictionary elements that are used to reconstruct the image.

2. The method as claimed in claim 1 wherein selecting a subset of patches using at least one predefined criterion comprises: estimating, for each patch, a likelihood that a dictionary element generated from the patch will be used to reconstruct the patch.

3. The method as claimed in claim 2 wherein selecting a subset of patches comprises: selecting a subset of patches from which dictionary elements are generated with a high likelihood of being used to reconstruct the patches.

4. The method as claimed in claim 2 wherein selecting a subset of patches comprises: clustering the plurality of patches into at least two clusters; and selecting a subset of patches from at least one cluster.

5. The method as claimed in claim 4 wherein the clustering is based on the estimated likelihood that a dictionary element generated from the patch will be used to reconstruct the patch, or based on different regions of the image.

6. The method as claimed in claim 1 wherein selecting a subset of patches using at least one predefined criterion comprises using any one or more of: a data value of each patch; aAL Ref: P46900W01 28 November 2025 darkness value of each patch; a brightness value of each patch; a standard deviation of each patch; a gradient of each patch; and a spatial frequency value of each patch.

7. The method as claimed in claim 6 wherein selecting a subset of patches using at least one predefined criterion comprises: obtaining the at least one predefined criterion and a threshold value for the at least one predefined criterion; and selecting a subset of patches by selecting all patches that have a value above the threshold value or below the threshold value for the at least one predefined criterion.

8. The method as claimed in claim 6 wherein selecting a subset of patches using at least one predefined criterion comprises: obtaining the at least one predefined criterion and a threshold value for the at least one predefined criterion; selecting a first subset of patches from the patches that have a value below the threshold value for the at least one predefined criterion; and selecting, after selection of the first subset, a second subset of patches from the patches that have a value above the threshold value for the at least one predefined criterion.

9. The method as claimed in claim 6 wherein selecting a subset of patches using at least one predefined criterion comprises: obtaining the at least one predefined criterion; determining a likelihood of each patch of the plurality of patches being selected based on the obtained at least one predefined criterion; and selecting a first subset of patches from the patches that have a low likelihood of being selected; and selecting, after the selection of the first subset, a second subset of patches from the patches that have a higher likelihood of being selected.

10. The method as claimed in any preceding claim wherein generating a dictionary further comprises: determining, for each dictionary element, a frequency of use of the dictionary element to reconstruct the image; and adjusting weights of each dictionary element in the dictionary using the determined frequency.AL Ref: P46900W01 28 November 202511. The method as claimed in any preceding claim wherein obtaining a dataset comprising at least one image comprises obtaining at least one image captured using any one of: an electron microscope, EM; a scanning electron microscope, SEM (including volume SEM); a Focused Ion Beam scanning electron microscope, FIBSEM; a transmission electron microscope, TEM; a scanning transmission electron microscope, STEM (including 2D STEM and 4D STEM); an ion-based microscope; and a helium ion microscope.

12. The method as claimed in any preceding claim wherein generating a plurality of potential dictionary elements comprises using two or more dictionary learning algorithms.

13. The method as claimed in claim 12 wherein generating a plurality of potential dictionary elements comprises: generating, using each of the dictionary learning algorithms, a plurality of potential dictionary elements from the selected subset of patches.

14. The method as claimed in claim 12 wherein selecting a subset of patches comprises selecting two or more subsets of patches, and wherein generating a plurality of potential dictionary elements comprises: generating, by applying a different dictionary learning algorithms to each of the two or more subsets of patches, a plurality of potential dictionary elements for the subsets of patches.

15. The method as claimed claim 12, 13 or 14 wherein reconstructing the image comprises using two or more dictionary elements generated by the two or more dictionary learning algorithms.

16. The method as claimed in any preceding claim wherein reconstructing the image comprises normalising the reconstructed image to a scale determined by the image from the dataset.

17. The method as claimed in any preceding claim wherein selecting a subset of patches comprises exclusively or preferentially selecting the subset of patches from subregions of the image that are of interest.

18. The method as claimed in any preceding claim wherein the dictionary learning algorithm is any of: a k-means clustering singular value decomposition, k-SVD, algorithm; and a beta process factor analysis, BPFA, algorithm.AL Ref: P46900W01 28 November 202519. A computer-implemented method for reconstructing sparse sampled images, the method comprising: obtaining sparse image data corresponding to a sparse sampled image; obtaining at least one dictionary generated using any of claims 1 to 18; and reconstructing the image using the at least one obtained dictionary to generate pixels of the sparse sampled image that are missing from the sparse image data.

20. The method as claimed in claim 19 wherein obtaining sparse image data comprises obtaining sparse image data corresponding to a sparse sampled image captured using any one of: an electron microscope, EM; a scanning electron microscope, SEM (including volume SEM); a Focused Ion Beam scanning electron microscope, FIBSEM; a transmission electron microscope, TEM; a scanning transmission electron microscope, STEM (including 2D STEM and 4D STEM); an ion-based microscope; and a helium ion microscope.

21. A computer-implemented method for reconstructing sparse sampled images using multiple dictionaries, the method comprising: obtaining sparse image data corresponding to a sparse sampled image; obtaining two or more dictionaries; and reconstructing the image using the two or more obtained dictionaries to generate pixels of the sparse sampled image that are missing from the sparse image data.

22. The method as claimed in claim 21 wherein obtaining sparse image data comprises obtaining sparse image data corresponding to a sparse sampled image captured using any one of: an electron microscope, EM; a scanning electron microscope, SEM (including volume SEM); a Focused Ion Beam scanning electron microscope, FIBSEM; a transmission electron microscope, TEM; a scanning transmission electron microscope, STEM (including 2D STEM and 4D STEM); an ion-based microscope; and a helium ion microscope.

23. The method as claimed in claim 21 or 22 obtaining two or more dictionaries comprises obtaining at least one dictionary that has been generated using any of claims 1 to 18.

24. The method as claimed in claim 21 , 22 or 23 wherein reconstructing the image comprises using each dictionary to reconstruct different regions of the sparse sampled image.AL Ref: P46900W01 28 November 202525. An imaging device comprising at least one processor coupled to memory configured to implement the method of claims 1 to 18 or claims 19 to 24.

26. The imaging device as claimed in claim 25 wherein the imaging device is any one of: an electron microscope, EM; a scanning electron microscope, SEM (including volume SEM); aFocused Ion Beam scanning electron microscope, FIBSEM; a transmission electron microscope, TEM; a scanning transmission electron microscope, STEM (including 2D STEM and 4D STEM); an ion-based microscope; and a helium ion microscope.