<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Anushka Thakur on Medium]]></title>
        <description><![CDATA[Stories by Anushka Thakur on Medium]]></description>
        <link>https://medium.com/@meanushkathakur748?source=rss-42d33f73c360------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Anushka Thakur on Medium</title>
            <link>https://medium.com/@meanushkathakur748?source=rss-42d33f73c360------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 12:46:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@meanushkathakur748/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Synthetic Data Generation using Quantum Advantage]]></title>
            <link>https://medium.com/@meanushkathakur748/synthetic-data-generation-using-quantum-advantage-0c5b8259a1b5?source=rss-42d33f73c360------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c5b8259a1b5</guid>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[quantum-machine-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[training]]></category>
            <dc:creator><![CDATA[Anushka Thakur]]></dc:creator>
            <pubDate>Sun, 08 Mar 2026 10:20:54 GMT</pubDate>
            <atom:updated>2026-03-11T18:52:13.568Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>PART I: THE PROBLEM WORTH SOLVING</strong></blockquote><blockquote><strong>1. Data Crisis</strong></blockquote><p>The most widely studied real-world dataset in this space, a collection of <strong>European cardholder transactions from September 2013, contains 284,807 transactions.</strong> Of these, <strong>exactly 492 are confirmed fraud. That is 0.172% of the total dataset.</strong> In the real-world production environment studied by the Machine Learning Group at <strong>Universite Libre de Bruxelles, working with Worldline on Belgian e-commerce data from 2018, the picture is only marginally better: approximately 400,000 transactions per day with around 1,000 confirmed fraudulent cases — still less than 0.3% of the daily volume.</strong></p><p>This imbalance has direct, measurable consequences for machine learning model performance. Even the best classical models, including XGBoost and logistic regression with carefully engineered features, achieve Card Precision scores in the range of 0.24 to 0.29 on simulated data and around 0.15 on real-world data. <strong>In plain terms: on the best available classical approaches, fewer than three in ten of the cards flagged as most suspicious each day turn out to be genuinely compromised.</strong></p><p>The fundamental question this post addresses is: <strong>can quantum machine learning provide a meaningful, principled, and practically grounded path to generating better synthetic fraud data — data that improves these downstream detection rates rather than simply inflating the size of the training set?</strong></p><p>The answer is yes, but only if the quantum approach is designed carefully, with an honest understanding of what the classical literature has already achieved, where its ceiling lies, and precisely which properties of quantum computation can overcome those specific limitations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*J1oFzo02cRPiqHRQcebBlQ.png" /></figure><blockquote><strong>1.1 What the Classical Literature Tells Us</strong></blockquote><p>The academic and industry literature on fraud detection has converged on a clear set of findings that any serious synthetic data approach must reckon with. These findings, drawn from extensive benchmarking on both simulated and real-world data, establish the baseline against which the quantum approach must be evaluated.</p><p>The first finding is that <strong>tree-based ensemble methods — Random Forest and gradient boosting algorithms such as XGBoost, LightGBM, and CatBoost — consistently outperform other classical approaches on static tabular fraud data. </strong>This dominance is well-documented and robust across datasets. On the ULB simulated dataset, Random Forest achieves an Average Precision of 0.658 and XGBoost achieves 0.639, compared to 0.606 for logistic regression.</p><p>The second finding is that <strong>feature engineering is not optional — it is decisive.</strong> The raw transaction features alone (amount, time, customer ID, terminal ID) are insufficient. <em>The ULB pipeline constructs fourteen engineered features that are critical to model performance: binary time flags for weekend and night transactions, customer-level spending behaviour aggregates over one-day, seven-day, and thirty-day rolling windows using the RFM (Recency, Frequency, Monetary value) framework, and terminal-level fraud risk scores over the same three windows, shifted back by a seven-day delay to account for the fraud reporting lag.</em></p><p>The third finding is perhaps the most important for synthetic data generation: <strong>real-world fraud patterns are fundamentally different from the patterns that researchers assume when building simulated datasets.</strong> When the ULB team trained a decision tree of depth two on their simulated data, it discovered that high transaction amounts were the dominant fraud signal — which is unsurprising because their simulator explicitly labelled high-amount transactions as fraudulent. When they trained the same model on real Worldline data, the tree found something far more subtle: <strong>the dominant fraud pattern was the combination of a recently compromised terminal (measured by the terminal risk score over a thirty-day window) with unusually high transaction velocity from the customer in the past twenty-four hours.</strong> This is the signature of a fraudster who has compromised a card and is racing to extract as much value as possible before detection. No simulator invented that pattern. It was discovered from real data.</p><p><em>This finding has a direct implication for synthetic data generation. </em><strong><em>If your synthetic data generation process is driven by human-designed rules — however sophisticated — you are teaching your model what a researcher imagines fraud looks like. The quantum approach proposed here is designed to teach the model what fraud actually looked like in 492 confirmed real cases, and then generate statistically faithful extensions of those real patterns at scale.</em></strong></p><blockquote><strong>1.2 Why Classical Synthetic Data Generation Falls Short</strong></blockquote><p>Several classical approaches exist for addressing the class imbalance problem in fraud detection. Each has well-understood limitations that motivate the quantum approach.</p><blockquote><strong>SMOTE and Oversampling Variants</strong></blockquote><p>The Synthetic Minority Oversampling Technique and its variants generate new minority-class samples by interpolating linearly between existing ones.<strong> SMOTE picks a real fraud case, finds its nearest neighbours in feature space, and places a new point somewhere along the line segment connecting them. The fundamental limitation is that SMOTE cannot generate samples outside the convex hull of the existing data. It can only interpolate between known fraud cases, never extrapolate to new fraud patterns. </strong>With 492 seed cases, the convex hull is small. SMOTE produces synthetic fraud that occupies the same region of feature space as the original cases — it does not expand the model’s exposure to novel fraud configurations.</p><blockquote><strong>Classical GANs on Small Datasets</strong></blockquote><p>Generative Adversarial Networks in their classical formulation train a generator network to produce samples indistinguishable from real data, while a discriminator network learns to distinguish real from generated samples. The two networks train in adversarial competition.<strong> On large datasets, GANs can learn extraordinarily rich generative distributions. On small datasets of 492 samples, classical GANs face a well-documented failure mode called mode collapse: the generator learns to produce a small number of convincing outputs that reliably fool the discriminator, rather than exploring the full diversity of the real distribution. </strong>The result is synthetic data that is statistically narrow — high in fidelity to a few modes of real fraud, but poor in coverage of the full pattern space. Mode collapse is not a hyperparameter tuning problem; it is a consequence of the generator having too few signal examples to navigate the loss landscape.</p><blockquote><strong>The ULB Simulation Approach</strong></blockquote><p>The most sophisticated classical approach in the literature is the transaction simulator developed by the ULB Machine Learning Group.<strong> This simulator generates synthetic transaction data using carefully designed customer profiles (with geographic locations, spending means and standard deviations, and transaction frequency parameters), terminal profiles, and three explicit fraud scenario rules.</strong> The simulator is impressive in its detail and has been the basis for extensive reproducible research. But it carries the fundamental flaw identified earlier: every fraud pattern in the simulated data was placed there by a human researcher who decided what fraud looks like.</p><blockquote><strong>PART II: QUANTUM COMPUTING FOUNDATIONS</strong></blockquote><blockquote><strong>2. Quantum Computing: What Actually Matters for This Problem</strong></blockquote><p>This section covers the specific quantum phenomena that are genuinely relevant to this problem.</p><blockquote><strong>2.1 Classical Bits and Their Limitations</strong></blockquote><p>Every classical computer, from the most basic smartphone to the largest bank data centre, processes information as binary digits — bits. A bit is always either zero or one. This binary representation is not a limitation of current hardware; it is a fundamental property of classical information theory. A classical computer with n bits can represent exactly one of 2^n possible states at any given moment. When a classical machine learning algorithm explores a high-dimensional parameter space, it does so sequentially — evaluating one configuration, updating its state, evaluating the next.</p><p><strong>For the fraud generation problem, this sequential exploration matters. The space of possible synthetic fraud transactions is defined by the joint distribution of all features simultaneously: the amount, the time of day, the customer’s recent transaction history, the terminal’s recent fraud history, and the correlations between all of these. </strong>Evaluating this joint distribution on 492 seed examples, without collapsing it into independent marginals, is computationally expensive for classical systems because maintaining the full joint distribution requires representing 2^n configurations for n features.</p><blockquote><strong>2.2 Qubits and Superposition</strong></blockquote><p>A qubit is the quantum analogue of a bit. <em>Unlike a classical bit, which must be zero or one, a qubit can exist in a superposition of both states simultaneously. This is not a metaphor or an approximation — it is a precise mathematical description of the qubit’s state vector, which lives in a two-dimensional complex Hilbert space. </em>The qubit’s state is described by two complex amplitudes whose squared magnitudes sum to one. When measured, the qubit collapses to zero or one with probabilities given by those squared amplitudes.</p><p><strong>The relevance to synthetic data generation is this: a system of n qubits in superposition simultaneously represents all 2^n possible configurations of those n features.</strong> When a fourteen-feature fraud transaction is encoded into fourteen qubits, the quantum state does not represent one transaction — it represents a probability distribution over all possible transactions simultaneously. The quantum computation then manipulates this entire distribution as a single object, rather than sampling from it one point at a time.</p><blockquote>Erwin Schrodinger’s famous thought experiment with a cat in a sealed box containing a radioactive decay mechanism captures the intuition. Until the box is opened and observed, the system exists in a superposition of alive and dead states simultaneously. The act of measurement collapses the superposition into a definite outcome. Similarly, when the quantum generator circuit is measured, the superposed state collapses into a specific synthetic transaction. Each measurement produces a different transaction, drawn according to the probability distribution that the quantum circuit has learned to represent.</blockquote><blockquote><strong>2.3 Entanglement: The Feature That Classical Machines Cannot Efficiently Replicate</strong></blockquote><p>Superposition alone is powerful but not sufficient. The deeper quantum resource for this problem is entanglement. When two or more qubits are entangled, their states are correlated in a way that cannot be decomposed into independent states for each qubit. The state of the joint system cannot be written as a product of the individual qubit states — the correlations are genuinely non-local.</p><p>For synthetic fraud data, this matters enormously.<strong> The ULB real-world experiment revealed that the most predictive fraud pattern was the simultaneous co-occurrence of a high terminal risk score and a high customer transaction velocity</strong>. These two features are correlated in real fraud — when a card is compromised, both signals tend to activate together. A classical generative model that independently samples from the marginal distribution of terminal risk scores and the marginal distribution of transaction velocity will occasionally produce the combination by chance, but it will not capture the genuine statistical dependence between them. It will underrepresent the cases where both signals are elevated simultaneously, which are precisely the most forensically informative cases.</p><p>Entangled qubits, created by quantum gate operations called controlled-NOT gates (CNOTs), encode exactly these joint correlations. The amplitude of one qubit’s state becomes conditioned on the state of another. When the circuit is trained on the 492 real fraud cases, the entanglement structure learns which feature combinations co-occur in real fraud and encodes those correlations into the quantum state. When the state is measured to produce a synthetic transaction, the sampled values respect those joint distributions — the generated transaction amount is correlated with the generated velocity signal in the same way that real fraud amounts are correlated with real fraud velocities.</p><blockquote><strong>2.4 Variational Quantum Circuits: The Bridge to Practical Implementation</strong></blockquote><p>Grover’s algorithm, which was central to the original conceptual formulation of this approach, requires fault-tolerant quantum hardware that does not exist at scale today. The practically implementable version of the quantum advantage uses a different but related paradigm: variational quantum circuits (VQCs), also called parameterised quantum circuits.</p><p>A variational quantum circuit is a quantum circuit whose gate operations are parameterised by trainable angles.<strong> Like the weights of a classical neural network, these angles are optimised through a training loop. The circuit is run on a quantum simulator (or real quantum hardware when available), measurements are taken, a loss function is computed, and the parameters are updated via gradient descent.</strong></p><p><strong>The key insight is that even a shallow variational circuit with a moderate number of qubits can represent probability distributions that would require exponentially many parameters to represent classically. This is the practical quantum advantage: not that the circuit runs faster, but that its parameter space is fundamentally richer for a given number of trainable parameters.</strong> On a small dataset of 492 examples, this richness is decisive — it is precisely the regime where the quantum generator can explore the fraud distribution more thoroughly than a classical generator of comparable parameter count.</p><blockquote><strong>PART III: THE QUANTUM PIPELINE</strong></blockquote><blockquote><strong>3. The Full Pipeline: Five Stages</strong></blockquote><p>The complete quantum synthetic fraud generation pipeline consists of five stages.</p><blockquote><strong>Stage 0: Feature Preparation and Quantum Encoding</strong></blockquote><p><strong>Why Raw Features Are Insufficient</strong></p><p>The Kaggle credit card fraud dataset provides twenty-eight PCA-compressed features labelled V1 through V28, along with transaction time, amount, and the fraud label. <strong>The PCA compression was applied for confidentiality, which means the original transaction details — merchant category, geographic location, customer history — are not directly visible.</strong> <em>Working with raw PCA components has a significant weakness for quantum encoding: the features are statistically uncorrelated by construction (PCA produces orthogonal components), which means encoding them into qubits would generate a state with no natural entanglement structure. The circuit would have to learn the full correlation structure from scratch.</em></p><blockquote>A smarter approach, <strong>informed by the ULB feature engineering pipeline, is to reconstruct interpretable signals from the available data before encoding. </strong>The ULB work demonstrated definitively that the fourteen engineered features — including time-of-day flags, rolling customer spending averages, and terminal risk scores — were more predictive than raw features alone. The same logic applies to quantum encoding: interpretable, semantically meaningful features produce a quantum state with genuine physical meaning, where the correlations the circuit learns correspond to real fraud behavioural patterns.</blockquote><blockquote><strong>The Five Encoding Signals</strong></blockquote><p>For each of the 492 real fraud cases, five categories of signal are computed before quantum encoding:</p><p>• <strong>Amount anomaly score: </strong>The transaction amount, expressed as the number of standard deviations above the mean fraud amount in the seed dataset, scaled using log transformation. The ULB neural network chapter explicitly demonstrated that raw transaction amounts follow a highly skewed distribution in real financial data, and that log-scaling produces a distribution much more amenable to machine learning. For quantum encoding, log-scaled features produce amplitudes that vary smoothly with transaction value, rather than the extreme amplitude imbalances that raw amounts would create.</p><p>• <strong>Time-of-day anomaly: </strong>A continuous signal encoding whether the transaction time deviates from the customer’s typical transaction window. The ULB baseline feature transformation identified that fraudulent patterns differ systematically between day and night transactions. Rather than the binary flag used in the classical pipeline, the quantum encoding uses a continuous signal to preserve the full information content for the quantum circuit to exploit.</p><p>• <strong>Transaction velocity: </strong>The rate of transactions in the period immediately preceding the current transaction. This is the signal that the real-world ULB decision tree identified as the most critical fraud indicator — fraudsters maximise transaction velocity after compromising a card because they know the window before detection is short. Encoding velocity as a continuous qubit amplitude means the quantum circuit can learn the precise velocity threshold that distinguishes fraud from legitimate high-frequency behaviour, rather than relying on a binary flag.</p><p>• <strong>Customer profile deviation: </strong>How far the current transaction deviates from the customer’s established spending pattern, computed using the RFM framework that the ULB pipeline validated across one-day, seven-day, and thirty-day windows. This signal captures the third ULB fraud scenario — the gradual escalation of transaction amounts by a fraudster using a compromised card while the legitimate cardholder continues normal activity.</p><p>• <strong>Terminal exposure signal: </strong>A risk score reflecting the terminal’s recent fraud history, computed with the seven-day delay that the ULB pipeline incorporated to model the fraud reporting lag. A fraudster operating on a compromised terminal generates a characteristic pattern in this signal over the twenty-eight days of the ULB Scenario 2 — the quantum circuit encodes this temporal signature as an amplitude pattern.</p><p>All five signals are scaled to the range negative pi to positive pi before encoding. This range is required because the quantum encoding uses angle encoding — each feature value is encoded as the rotation angle of a quantum gate operation. Scaling to this range ensures that the full dynamic range of each feature maps uniformly to the full range of qubit states, avoiding the over-compression that would occur if features were scaled to a narrower range.</p><p><strong>ENCODING INSIGHT</strong></p><p><em>The ULB pipeline uses the same feature architecture to build a fraud detector trained on labelled data. The quantum pipeline uses the same feature architecture to encode the fraud distribution itself into a quantum state. The design inspiration is shared; the purpose is entirely different.</em></p><blockquote><strong>Stage 1: The Quantum GAN Architecture</strong></blockquote><blockquote><strong>Why a Quantum Generator with a Classical Discriminator</strong></blockquote><p>The Quantum Generative Adversarial Network (QGAN) is the central engine of the synthetic data pipeline. It follows the general GAN framework — a generator and a discriminator trained in adversarial competition — but with a critical difference:<strong> the generator is a variational quantum circuit rather than a classical neural network. The discriminator remains classical.</strong></p><p>This asymmetric design is deliberate and principled. The generator’s job is to learn the probability distribution of the 492 real fraud cases and generate new samples from that distribution. This is precisely the task where the quantum advantage is most relevant — the quantum circuit’s entangled parameter space allows it to represent joint distributions over fourteen features far more efficiently than a classical network with comparable parameter count on a dataset of 492 examples. The discriminator’s job is to evaluate whether a given sample is statistically consistent with real fraud. This is a classification task on tabular data, and the ULB literature is unambiguous that classical networks excel at this task. Using a quantum discriminator would add complexity without benefit.</p><blockquote><strong>The Generator Circuit Architecture</strong></blockquote><p>The quantum generator circuit operates in three phases per forward pass. <strong>In the first phase, a noise vector — the quantum analogue of the latent space in a classical GAN — is encoded into the initial qubit states via angle encoding. </strong>This noise vector serves the same purpose as in a classical GAN: it is the source of stochastic variation that allows the generator to produce different outputs on different runs. Without noise, the generator would always produce the same output regardless of training.</p><p><strong>In the second phase, a sequence of variational layers is applied.</strong> Each layer consists of parameterised rotation gates on every qubit, followed by a ring of CNOT gates that create entanglement between adjacent qubits. The rotation gates are the trainable parameters — their angles are updated via gradient descent during training. The CNOT gates create the entanglement structure that allows the circuit to learn joint feature correlations. The ring topology — where the last qubit is also connected back to the first — ensures that no qubit is informationally isolated from the rest of the circuit. After six layers of alternating rotations and entanglement, the quantum state encodes a complex probability distribution over all 2¹⁴ possible feature configurations simultaneously.</p><p><strong>In the third phase, the state is measured.</strong> Each qubit collapses from its superposed state to a definite value, drawn according to the probability amplitude it has accumulated through the circuit. The fourteen measurement outcomes together form one synthetic fraud transaction. This transaction is then passed to the classical discriminator for evaluation.</p><blockquote><strong>The Discriminator Architecture</strong></blockquote><p>The classical discriminator is a feed-forward neural network whose architecture is directly informed by the ULB neural network chapter. It uses LeakyReLU activations rather than standard ReLU — LeakyReLU is preferred for discriminators because it maintains gradient flow even for negative inputs, preventing the dead neuron problem that standard ReLU can cause in adversarial training. Dropout regularisation is applied between layers, following the ULB finding that dropout with a parameter of around 0.2 to 0.3 provides effective regularisation against overfitting on small datasets. The output is a single sigmoid-activated neuron, producing a probability that the input sample is real fraud rather than generated fraud.</p><blockquote><strong>The Adversarial Training Dynamic</strong></blockquote><p>The QGAN training loop alternates between two optimisation steps. <strong>In the discriminator step, the discriminator is updated to correctly classify real fraud samples (drawn from the 492 seed cases) as real and quantum-generated samples as fake.</strong> In the generator step, the quantum circuit is updated to produce samples that the discriminator cannot distinguish from real fraud. The generator loss is precisely the discriminator’s confidence that generated samples are fake — the generator succeeds when the discriminator is maximally confused.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*LCHCLhUNmC1trprR.gif" /><figcaption>Different optimisers navigating the same loss landscape — adaptive methods reach the optimum faster and more reliably, which is why Adam is used to train both the quantum generator and the classical discriminator in this pipeline.</figcaption></figure><p><strong>The Adam optimiser is used for both the quantum generator and the classical discriminator, following the ULB finding that Adam converges approximately ten times faster than SGD and reaches better optima on fraud detection tasks. </strong>Label smoothing is applied to the real labels during discriminator training — rather than labelling real samples as exactly one, they are labelled as 0.9. This prevents the discriminator from becoming overconfident on the small real dataset, which would produce vanishing gradients for the generator.</p><blockquote><strong>Stage 2: Quantum Reservoir Computing for Temporal Pattern Capture</strong></blockquote><p><strong>The Temporal Dimension: What the QGAN Cannot Capture Alone</strong></p><p>The QGAN generator learns the marginal distribution of individual fraud transactions — the statistical fingerprint of what a single fraud transaction looks like. But real fraud, as the ULB literature consistently emphasised, is not a collection of independent events. It unfolds as a temporal sequence with characteristic dynamics.</p><p>The ULB real-world decision tree finding captures this precisely: the dominant real-world fraud pattern was not any single transaction feature, but the co-evolution of terminal risk and customer velocity over time. The fraudster’s behaviour creates a trajectory in feature space: an initial test transaction of low value, followed by escalating amounts, with transaction velocity rising as the fraudster races against detection. Each individual transaction in this sequence might appear borderline when examined in isolation. The sequence as a whole is unmistakably fraudulent.</p><p>Classical approaches to capturing this temporal dimension require sequential models — Convolutional Neural Networks, Long Short-Term Memory networks, or attention-based architectures. The ULB deep learning chapter covered all three. But all of these architectures share a common requirement: they need a substantial quantity of labelled transaction sequences to train effectively. An LSTM must learn, through gradient descent over many examples, which aspects of a transaction sequence are relevant to fraud prediction. With 492 total fraud cases, many of which represent isolated single transactions rather than full sequences, the classical sequential models cannot learn reliably.</p><blockquote><strong>The Quantum Reservoir Solution</strong></blockquote><p>Quantum Reservoir Computing (QRC) addresses this problem through a fundamentally different mechanism. <strong>A quantum reservoir is a fixed, randomly initialised quantum circuit that acts as a dynamic memory system. Unlike the QGAN generator, the reservoir weights are not trained at all. The quantum dynamics of the reservoir — the natural evolution of the entangled qubit system as successive inputs are encoded — create temporal memory through quantum interference, without any gradient-based learning.</strong></p><blockquote>The physical mechanism is wave interference. When two quantum waves with aligned phases combine, their amplitudes add constructively, producing a stronger signal. When they are out of phase, they cancel destructively. As successive transactions are encoded into the quantum reservoir, the quantum state of the system becomes a superposition of the current input and the residual quantum state from all previous inputs. Transactions that are statistically consistent with the same fraud sequence create constructive interference — their combined effect on the quantum state is amplified. Transactions that are statistically unrelated produce destructive interference — their effects cancel. The reservoir’s quantum state at any point in time is therefore a temporal fingerprint of the fraud sequence that has been processed, without requiring any training.</blockquote><blockquote><strong>Calibration from the Classical Literature</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*Ir--FMGcuOYYo6UejxMKXA.png" /></figure><p>A key practical contribution of the ULB simulation framework is the identification of empirically motivated temporal window sizes for fraud. The ULB simulator established that terminal compromise events last approximately twenty-eight days and card compromise events last approximately fourteen days. These durations are not arbitrary — they reflect the typical forensic timelines of real fraud investigations and reporting lag, as the ULB team validated against the Worldline real-world dataset.</p><p>These durations directly calibrate the quantum reservoir’s memory depth. The reservoir is configured so that the quantum echo of a transaction decays on a timescale consistent with these windows — quantum states from transactions more than twenty-eight days ago contribute negligible amplitude to the current reservoir state, while transactions within the past fourteen days remain significant. This calibration transforms the reservoir from an abstract quantum system into one that is physically tuned to the actual temporal dynamics of financial fraud.</p><p>The practical implication is significant: when the reservoir processes a sequence of transactions that exhibits the velocity-escalation pattern identified in the real-world ULB experiment, the constructive interference between the earlier low-value transactions and the later high-value ones produces a distinctive reservoir state signature. When the quantum generator is subsequently conditioned on this reservoir state, the synthetic transactions it produces will exhibit the same temporal escalation pattern — not because it was hardcoded, but because the quantum dynamics naturally amplify co-temporal fraud signatures.</p><blockquote><strong>The Readout Layer</strong></blockquote><p>The only trained component of the QRC stage is a linear readout layer — a single classical linear transformation that maps the quantum reservoir’s output state back to the feature space. This is analogous to the readout layer in classical reservoir computing, where a simple linear classifier is trained on top of a fixed nonlinear dynamical system. The readout layer requires very few training examples because it is only learning a linear projection, not the temporal dynamics themselves. The quantum reservoir provides those dynamics for free, through the natural evolution of the quantum state.</p><blockquote><strong>QRC VS LSTM</strong></blockquote><p><em>The LSTM learns temporal patterns through thousands of gradient updates on long sequences. The quantum reservoir captures temporal patterns through quantum interference on every input, with zero training. On 492 fraud cases, the LSTM cannot learn. The quantum reservoir works immediately.</em></p><blockquote><strong>Stage 3: Iterative Generation and Dataset Growth</strong></blockquote><p>The generation process is iterative by design. This is one of the most important architectural decisions in the pipeline, and it directly addresses the mode diversity problem.</p><p><strong>In the first round of generation, the QGAN generator produces synthetic fraud cases using only the information encoded from the 492 seed examples. These first-generation synthetic cases are relatively conservative — they stay close to the statistical fingerprint of the seed data, because the circuit has only 492 examples of signal to work from.</strong></p><p>In subsequent rounds, the first-generation synthetic cases are added to the training pool alongside the original 492 seed cases. The QGAN is then retrained — or fine-tuned — on this expanded pool. With more fraud examples available, the circuit explores a slightly larger region of the fraud distribution. The second-generation synthetic cases exhibit more diversity than the first generation while remaining statistically coherent with real fraud patterns.</p><p>This iterative process continues for a configurable number of rounds. Each round expands the pool, giving the next round a richer distribution to learn from. The original 492 seed cases are the fixed anchor — they prevent the synthetic distribution from drifting away from real fraud patterns through accumulation of errors. Every generated case is automatically labelled as Class equal to one, requiring no manual annotation.</p><p>The mathematical intuition is that the quantum circuit is performing iterative importance sampling over the fraud distribution. Early rounds sample from the high-probability modes of the distribution — the most typical fraud cases. Later rounds, with a richer signal pool, sample from lower-probability but still real modes — the less common fraud configurations that are precisely the ones most likely to be missed by models trained only on the 492 seed cases.</p><blockquote><strong>Stage 4: Validation Against the Classical Baseline</strong></blockquote><p>A synthetic data pipeline that cannot be validated is a pipeline that cannot be trusted. The validation strategy for the quantum approach is designed to answer one question directly and honestly: does a fraud detection model trained on quantum-generated synthetic data outperform the same model trained on classically-augmented data, on real held-out fraud cases?</p><p>This validation uses the same performance metrics that the ULB literature established as most meaningful for real fraud detection systems. Card Precision at the top k predictions per day is the primary metric, because it reflects the operational reality of fraud investigation teams: a fixed number of analysts can review a fixed number of suspicious cases per day, and the precision of those top-k predictions is what determines how many real compromised cards are caught. The Average Precision metric, which integrates precision across all possible thresholds, serves as the secondary metric. The AUC ROC is reported for completeness but is de-emphasised, because the ULB literature demonstrated that it gives disproportionate weight to performance at high false positive rates that are operationally irrelevant.</p><p>The baseline comparison is not against random data or simple SMOTE augmentation. It is against the best classical approach in the literature: XGBoost or Random Forest trained on the original 492 fraud cases plus SMOTE-augmented samples, with the full fourteen-feature ULB engineering pipeline applied.</p><blockquote><strong>PART IV: THE STRATEGIC ADVANTAGE</strong></blockquote><blockquote><strong>4. Why This Approach Is Strategically Superior</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*Nm9jKAVPBHUrz3BB1eBksA.png" /></figure><blockquote><strong>4.2 The Entanglement Advantage in Detail</strong></blockquote><p>The most practically important quantum advantage is the encoding of joint feature distributions through entanglement. To understand why this matters, consider the real-world fraud pattern the ULB team discovered: simultaneous elevation of terminal risk score and customer transaction velocity.</p><p>In a classical generative model trained on 492 examples, learning the joint distribution of two features requires seeing enough cases where both features are simultaneously elevated to estimate the conditional distribution — the probability that velocity is high given that terminal risk is high. With 492 examples spread across a fourteen-dimensional feature space, the joint density at any specific point in that space is very low. The classical generator will severely underestimate the probability mass in the joint-elevation region, because it has seen too few examples there to fit it reliably.</p><p>In the quantum generator, the CNOT gate between the qubit encoding terminal risk and the qubit encoding transaction velocity creates a direct quantum coupling between those two features. The training process adjusts the rotation angles of both qubits simultaneously, so that the amplitude in the joint-elevation state is correctly captured even when the individual feature frequencies are low. The quantum circuit is not estimating the joint distribution from co-occurrence statistics — it is encoding the joint distribution directly into the correlated qubit amplitudes. This is a structural advantage that cannot be replicated by adding more parameters to a classical model.</p><blockquote><strong>4.3 The Reservoir Advantage Over LSTM</strong></blockquote><p>The ULB deep learning chapter documented five architectures for sequential fraud modelling: feed-forward networks, autoencoders, CNNs, LSTMs, and LSTMs with attention. The progression from feed-forward to LSTM reflects the classical community’s recognition that temporal context matters deeply for fraud detection — the same insight motivates the QRC stage of this pipeline. But the classical sequential models all require substantial training sequences.</p><p>Consider the LSTM specifically. Its gating mechanism — the input gate, forget gate, and output gate — must be trained to learn which aspects of a transaction sequence are relevant to fraud prediction. These gates are parameterised by weight matrices that are updated through backpropagation through time. To learn the velocity-escalation pattern, the LSTM must see many examples of the sequence: small transaction, pause, slightly larger transaction, shorter pause, large transaction, detection. With 492 total fraud cases in the Kaggle dataset, many of which are isolated single transactions without a recoverable sequence context, there are simply not enough training sequences to fit these gate parameters reliably.</p><p>The quantum reservoir’s advantage is that it does not learn the temporal dynamics at all. The quantum dynamics of a randomly initialised entangled circuit produce rich temporal memory through interference patterns that are a fixed property of quantum mechanics. The reservoir does not need to be taught that velocity escalation is suspicious — it automatically amplifies patterns where successive inputs are statistically related through constructive interference. The only thing that needs training is the linear readout layer that maps the reservoir’s quantum state to the feature space, and a linear layer can be trained reliably on very few examples.</p><blockquote><strong>The main motive of this is to generate synthetic data using quantum machinne learning so that banks can train their models on these datasets and achieve greater accuracy. here I have used fraud detection data only as an example to explain my thought of “Synthetic data generation using quantum machine learning”. I am still researching about the approaches to be implemented for the same!</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c5b8259a1b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Journey from Inspiration to Innovation]]></title>
            <link>https://medium.com/@meanushkathakur748/journey-from-inspiration-to-innovation-2e7c8a1ece4c?source=rss-42d33f73c360------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e7c8a1ece4c</guid>
            <category><![CDATA[research-methods]]></category>
            <category><![CDATA[abstract-submission]]></category>
            <category><![CDATA[conference]]></category>
            <category><![CDATA[research-and-development]]></category>
            <category><![CDATA[research-reports]]></category>
            <dc:creator><![CDATA[Anushka Thakur]]></dc:creator>
            <pubDate>Wed, 06 Mar 2024 05:00:50 GMT</pubDate>
            <atom:updated>2024-03-06T05:00:50.190Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*86rSPs62IyOjf3d0ULjgOQ.png" /></figure><p><strong>Information about the competition:</strong></p><p>The ISSRDC, which stands for the International Space Station Research and Development Conference, is a yearly event that brings together different kinds of people: researchers, scientists, engineers, and policymakers. They all share an interest in space and the amazing International Space Station (ISS). At the conference, there are talks, group discussions, learning sessions, and displays about many subjects like space science, technology, engineering, and how we use the ISS. People who come to the conference are from different places like government, schools, businesses, and other countries, and they’re all interested in studying space and doing research. I would like to give a short glimpse of how exactly I developed an interest in this research field and then move ahead with the actual topic in hand.</p><p><strong>Nov 17th, 2019: Part 1 — Start of an Inspiration-The Spark:</strong></p><blockquote>“<strong>Any physical theory is always provisional, in the sense that it is only a hypothesis: you can never prove it. No matter how many times the results of experiments agree with some theory, you can never be sure that the next time the result will not contradict the theory. On the other hand, you can disprove a theory by finding even a single observation that disagrees with the predictions of the theory.”</strong></blockquote><p>That’s true. These are the lines from the book ‘<strong>The Brief History of Time,’</strong> and when I read the book, that was the first time I learned about the astonishing world of astronomy and astrophysics. Skipping ahead to my 11th Standard, there came a significant moment when my teacher told me about my selection for the INSPIRE camp. It was set to happen at the R C Patel College of Engineering in Shirpur, and I couldn’t contain my excitement. This five-day research camp was going to be my first time leaving home for such an adventure, and I looked forward to meeting students from other places. Being from a small village, not many folks understood what a research camp was all about. We were told that scientists from ISRO, BARC, and professors from IISER Pune would be giving talks, which added to the thrill of the experience.</p><p><strong>Nov 19th, 2019: In Pursuit of an Idea: </strong>During the INSPIRE camp, we had a meeting led by a scientist from ISRO. They talked about the Aaditya L1 mission, which was really interesting! Then, they surprised us with a competition. We could share our space research ideas. Everyone, including me, was very excited. The competition was going to happen the next day. I quickly went back to my room. I thought hard and wrote down my idea and summary. Then, I sent them in.</p><p><strong>Nov 20th, 2019: Bots for space: A winning idea-</strong> Today, they announced the competition results. I didn’t expect much as Prof. Lale revealed the winner. But then, they called out my name! I was shocked—I won! My idea was about using tiny bots to clean up space debris instead of doing more tests that could harm the space station. I got a book and a certificate as a reward. It was a special moment for me.</p><p><strong>March 29th, 2023: Part 2- Idea:</strong> As I was casually scrolling through Google, something caught my eye —<strong> a CALL FOR ABSTRACTS for the 12th Annual International Space Station Research and Development Conference (ISSRDC). Organized by the American Astronautical Society (AAS), the International Space Station National Laboratory, and NASA, this call for abstracts signaled an opportunity of a lifetime.</strong></p><p><strong>Conference Overview:</strong></p><p><strong>The 2023 International Research and Development Conference (ISSRDC) was scheduled to take place in person from Monday, July 31 to Thursday,</strong> <strong>August 3 at the prestigious Hyatt Regency Hotel in Seattle, Washington.</strong> The ISSRDC serves as a platform to unite the global ISS user community, pushing the boundaries of innovation in space research and development. With the increasing demand for space research, the ISS has emerged as the ultimate platform for microgravity research, development, and remote sensing.</p><p><strong>Dates:</strong> The dates for the conference and ISSRDC competition for submitting abstracts change every year, but usually, submissions start around March and end around the end of April.</p><p><strong>Submission Process: </strong>The competitions offer a multitude of avenues for abstract submission, spanning across diverse realms such as Biology and Medicine, Applications of Space Products, Earth and Space utilizing Remote Sensing, Human Health in Space, Technology Development, etc. Generally, accepted abstracts are selected for parallel technical sessions or poster displays, offering participants an opportunity to present their research to a diverse audience. Then the Technical Committee reserves the right to place the presentation/poster in the most appropriate session, ensuring maximum visibility and impact. <strong>We will get to Meet the trailblazers who are advancing their R&amp;D goals, fundamental science objectives, and STEM education efforts and attend technical sessions, panel discussions, and lightning talks — all highlighting space station research.</strong></p><p><strong>Evaluation Criteria:</strong> The American Astronautical Society (AAS) ISS Research Technical Committee evaluates abstracts based on several criteria:</p><p><strong>Quality:</strong> ensuring the abstracts meet high standards of research and presentation. Relevance: Assessing the relevance of the proposed research to current space exploration objectives.</p><p><strong>Innovation:</strong> recognising innovative approaches and ideas that contribute to advancements in space research.</p><p><strong>Substance Merit:</strong> evaluating the substance and depth of the proposed research.</p><p><strong>Future Practical Application: </strong>Considering the potential practical applications and implications of the research.</p><p><strong>Part 3: Innovation:</strong> And here, my 11th-grade idea proved to be invaluable. After immersing myself in research papers and space exploration videos, delving into the intriguing realm of the International Space Station and its microgravity environment, inspiration struck. I conceived an idea centred around <strong>the utilisation of ISS MISSE to assess regolith behaviour and the corresponding impacts on small bodies. </strong>Regolith is defined as the unconsolidated material that is loosely present on top of the planet’s bedrock. This definition extends to asteroids, which are small rocky remnants of the early Solar System and other planetary system formation processes. Improvements in the understanding of surface geology could help future exploration missions and would also go a long way in perhaps, colonizing other planets. Taking guidance from one of my senior Ojas, I embarked on the journey of submitting abstracts, not just one, but two. The second idea that I proposed was equally ambitious and innovative.</p><p>It revolved around the sustainable extraction of energy from charged particles using a cyclotron onboard the ISS. <strong>This cyclotron, once adopted, could serve as a compact electron cyclotron resonance (ECR) proton source. Its purpose was to provide a reliable and cost-effective solution for various applications, including radiation shielding on the ISS and supporting hardware components.</strong> Out of the two ideas submitted, only the first one was chosen by ISSRDC. We received confirmation via email. Although the second idea didn’t make it, the concept of using ISS MISSE for assessing regolith behaviour was recognised, highlighting the power of innovative ideas in space exploration.</p><p><strong>Note: </strong>When selecting an idea for your abstract, aim for something small and practical. It’s easy to get carried away with big ideas, but they might not be feasible. Take your time to think it through and look at all angles before making a decision. For instance, my second idea was ambitious and required a lot of expertise, which might be why it wasn’t chosen. So, focus on choosing a topic that’s manageable and can be carried out on the ISS.</p><p><strong>Part 4: Conference day: </strong>Unfortunately, despite my initial plans to attend the conference in Seattle, Washington for the idea presentation, unforeseen circumstances prevented me from being there in person. However, I made the decision to attend the conference online instead. The morning keynote featured representatives from NASA’s international partners, who discussed the importance of collaboration in space and how they are helping to inspire the next generation of explorers. Hazza AlMansoori, chief of the United Arab Emirates astronaut office, said, “We’re really just joining this race, but we cannot do it by ourselves; we have to do it together. This is the beauty of the International Space Station and collaboration and the international community coming together.” In a Lightning Talk, Angela Hart, program manager for the Commercial LEO Development Program Office at Johnson Space Center, discussed the importance of identifying the right requirements for future commercial LEO destinations. “We have a big challenge in this plan to go to commercial LEO destinations and really develop this commercial LEO economy,” she said. “We know this strategy that we have is a major paradigm shift from what we have done before, and we know it’s going to take different ways of doing business to be successful.” After that Meghan Everett, NASA’s ISS Program deputy scientist, moderated a fireside chat on the motivations and inner workings of NASA’s Human Research Program (HRP), which performs critical spaceflight research on the ISS to prepare for Artemis and Mars exploration missions. The panel emphasized the importance of partnerships between government and the commercial space industry to address the challenges expected during future space exploration. It was basically a three-day event and Day 3 wrapped up with the presentation of ISSRDC awards. <strong>Among the winners was Isabel Jiang, a high school student from Hillsborough, CA. Her project focused on studying how latent viruses become active in space which was quite impressive.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*xlMlPko_NNkcoMdg7SE8cg.png" /></figure><p><strong>Part 5: End Note:</strong> My journey from being inspired by Stephen Hawking’s words to getting selected for presenting at the ISSRDC Conference has been truly amazing. Winning the INSPIRE camp competition along the way showed me the importance of passion and perseverance in scientific progress. As an end note the message that I would like to share here is</p><blockquote>“We are supposed to be different, Folks. Try to learn as many things as you can and nurture your mind with knowledge and try to preserve your unique identity and keep your interests alive”.</blockquote><p>To conclude my experience, I recall a quote from the book “A Brief History of Time,&quot; which inspires us to seek knowledge and understanding in various fields, fostering a culture of curiosity and lifelong learning. and it goes,</p><blockquote>“However if we do discover a complete theory, it should in time, be understandable in broad principle by everyone, not just a few scientists. Then we shall all be able to take part in the discussion of why the universe exists. If we find the answer to that, it would be the ultimate triumph of human reason. For then we would know the mind of God.’’</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*AeYcy9kdKArj9jEfkgSCnQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e7c8a1ece4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Compression in Neural Networks]]></title>
            <link>https://medium.com/@meanushkathakur748/compression-in-neural-networks-085b2c25e872?source=rss-42d33f73c360------2</link>
            <guid isPermaLink="false">https://medium.com/p/085b2c25e872</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[compression]]></category>
            <dc:creator><![CDATA[Anushka Thakur]]></dc:creator>
            <pubDate>Mon, 29 Jan 2024 18:44:59 GMT</pubDate>
            <atom:updated>2026-02-28T07:56:18.192Z</atom:updated>
            <content:encoded><![CDATA[<p>As I delve into the field of neural networks, I’ve noticed that explanations for certain design choices often lean towards a pragmatic<strong> “it works this way, and changing it breaks things” perspective.</strong> While I’m still in the early stages of exploration, this seems to be a common theme. Despite this, one aspect that has truly impressed me is the remarkable efficiency of neural networks in expressing substantial amounts of information with a minimal number of connections.</p><p>Consider a basic neural network where I connect inputs directly to outputs. While this may not be the most intricate architecture, it serves to highlight the network’s ability to convey substantial data with just a simple connection scheme. It’s a testament to the power of neural networks in distilling complex relationships and patterns with remarkable parsimony.</p><p>1_fully_connected</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*Je7aVO5ZzDyIWE_6zdY2DQ.png" /></figure><p>In the process of teaching this neural network a specific pattern — where input 1 triggers output 2, input 2 triggers output 3, input 3 triggers output 4, and input 4 triggers output 5, with no firing for output 1 and input 5 — a crucial algorithm called backpropagation comes into play. Through repeated iterations, the network is informed about the expected output for each input.</p><p>Now, focusing on the outcomes, I enhance the strength of the connections that the network successfully learns and weaken those connections that it does not effectively grasp. This adjustment aims to reinforce the network’s ability to accurately associate inputs with the desired outputs, creating a more refined and effective neural network for the specified pattern.</p><p>2_learned</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*rONWEO3Xf0qqrs1wSov4xg.png" /></figure><p>What happened here is that the weights for some connections have increased, while the weights for most connections have decreased. I haven’t talked about weights yet. Weights are what neural networks learn. When we draw networks, the nodes seem more important. But what the network actually learns and stores are weights on the connections. In the picture above the thick lines have a weight of 1, the others have a weight of 0. (weights can also go negative, and they can go up arbitrarily high)</p><p><strong>HIDDEN LAYERS</strong><br>A simple network like the one above can learn simple patterns like this. If we want to learn more complex patterns, we have to create a network that has more layers. Let’s insert a layer with two neurons in the middle:</p><p>3_middle_layer</p><p>There are many possible behaviors for those neurons in the middle, and that is the part where most of the magic happens in neural networks. It seems like picking what goes there just requires experimentation and experience. A simple neuron would be the tanh neuron which does these three steps:</p><p>add up all of its inputs multiplied by their weights<br>calculate tanh() on the sum<br>fire the result to its outputs multiplied by their weights<br>Why tanh? Because it has a couple convenient properties, and it happens to work better than other functions that have the same properties. But mostly it’s “beause it works like this and it doesn’t work when we change it.”</p><p>If you count the number of connections on that last picture you will notice that there are fewer than there were in the first network. There were 5*5=25 at first, now there are 5*2*2=20. That reduction would be larger if I had more input and output nodes. For 10 nodes that reduction would be from 100 connections down to 40 when inserting two nodes in the middle. That’s where the compression in the title of this blog post comes from.</p><p>The question is whether we can still represent the original pattern in this new representation. To show why that is not obvious, I’ll explain why it doesn’t work if you just have one middle neuron:</p><p>If I initialize the weights on here so that the first node fires the second output, all nodes will fire the second output:</p><p>5_single_middle_weights</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*9qV3W82XRdz-CRziFL9esQ.png" /></figure><p>That one node in the middle messes up the ability for my network to learn my very simple rule. This network can not learn different behaviors for different input nodes because they all have to go through that one node in the middle. Remember that the node in the middle just adds all of its inputs, so it can not have different behaviors depending on which input it receives. The information of where a value came from gets lost in the summation.</p><p>So how many nodes do I need to put into the middle to still be able to learn my rule? In real neural networks you usually put hundreds of nodes into that middle layer, but what is the minimal number to learn my pattern? Before I get to the answer I need to explain one more type of neuron that enables my compression: The softmax layer. If I make my output layer a softmax layer, that means that it will look at all the activations on that layer, and that it will only fire the output with the highest activation. That’s where the “max” in the softmax comes from: It fires the max node. The “soft” part is also very important in other contexts because a softmax layer can fire more than one output, but in my case it will only ever fire one output so we’ll stay with this explanation. If I make my middle layer a tanh layer and my output layer a softmax layer, I can represent my pattern just by having two nodes in the middle:</p><p>6_learned</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*iKMF302R5GYe1ROosBXGyw.png" /></figure><p>Here I’ve made lines with positive weights blue, and lines with negative weights red. This means that if for example the first input fires, I will get these values on the nodes:</p><p>7_learned_first_input</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*e6Hd5LNJV-dG62o7D5KPZA.png" /></figure><p>The first node activates both the middle nodes. That activates the second output node with weight two. The next two nodes are canceled out because they receive a positive weight from one of the middle nodes and a negative weight from the other. The last node is activated with weight -2. If I then run softmax on this only the top node will fire. Meaning the bottom node will not fire a negative output. Softmax suppresses everything except for the most active node.</p><p>This is a little bit simplified, because the tanh layer doesn’t give out nice round numbers and the softmax layer wants bigger numbers, but those complications are not necessary to understand what’s going on, so I’ll keep the numbers in this blog post simple. (the real weights in my test code are +9 and -9 on the connections going from the input layer to the middle layer, and +26 and -26 on the connections going from the middle layer to the output layer. I don’t know why those numbers specifically, that’s just where the network decided to stabilize)</p><p>Let’s quickly run through this for the other three cases as well:</p><p>8_learned_second_input</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*t-HrKF2kh3cI1819Syy3pA.png" /></figure><p>10_learned_last_input</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*Z1_Adio7YyPK_cdXLiQbig.png" /></figure><p>As you can see there is always one clear winner and then the softmax layer at the end will make sure that only that one fires and the other outputs remain quiet. When I first saw this behavior I was quite impressed. In fact I saw this behavior on a network with eleven inputs, eleven outputs and just two middle nodes. Can you think of how the above layer would work with eleven inputs? It seems like there’s only four possible combinations for these weights and we’ve used all of them, right? You’re underestimating neural networks. It’s quite impressive how they will try to squeeze any pattern that you throw at them into what’s available. For eleven inputs and eleven outputs it looks like this:</p><p>14_eleven_numbers</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*_hOES0Oz5uheiRRdKGzrJw.png" /></figure><p>That is a lot of connections and a lot of numbers. The network has now decided to make some connections stronger and other connections weaker. I couldn’t keep using colors and line-style to visualize different strengths because now there are a lot of different values. Whenever I tried to simplify and not use numbers I’d break the network. So instead I just show the numbers. The upper number on each node is the weight of the connection to/from the upper node in the middle layer, and the lower number is the weight of the connection to/from the lower node in the middle layer.</p><p>Let’s walk through a random example and see how it works:</p><p>15_eleven_numbers_example</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*jwCZvg6sm6p9fsY9fFM0nw.png" /></figure><p>The node with the largest output value (72 = -10 * -4 + 8 * 4) is the one we want to fire, and softmax will select that. In this picture I’m just multiplying the numbers linearly because the weights on the left actually already have tanh applied (and were then multiplied by 10 to get them into the range -10 to 10 which is slightly nicer for pictures than the range -1 to 1). I can do that in this case since I only ever fire one input. And if I can just do linear math the example is easier to follow.</p><p>I’ll post a second example to show that the weights will activate the desired output for any input:</p><p>Here also for my given input n, output n+1 had the highest value at the end and softmax will make that output fire. You could go through a couple more examples and convince yourself that this network has learned the pattern that I want it to learn.</p><p>I don’t know about you, but I think this is quite impressive. For the small first network I think I could have figured out how to put the numbers in manually. (once you know the trick that the nodes can cancel each other out it’s easy) For all the connections on the larger network you would have to be very good at balancing these weights, and I honestly don’t think I could have done this by hand. The neural network however seems to just figure this out. Or rather: it figures this out if you use a tanh layer in the middle and a softmax layer at the end. If you don’t, it will stop working.</p><p>Since I’m using real numbers now I might as well explain how softmax works. Softmax uses the number at the end as an exponent and then normalizes the column afterwards. If I use 2^x it should be obvious that 2⁵⁶, the highest number, is a lot bigger than 2⁴⁴, the next highest number. If I have 2⁵⁶ in the column and I normalize it, all the other activations will go very close to zero and the output that I want to fire will be close to 1. Also by using an exponent I get no negative numbers. 2^-96 is just a number that’s very close to zero. The standard is to use e^x instead of 2^x, and I also use that, it’s just that as a programmer I find it easier to explain and easier to understand using powers of two.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*emkRXVxDN-fsJkNLwNlgmA.png" /></figure><p><strong>HOW THIS WORKS</strong><br>With that information I can give a bit of an intuition why this happens to work if you use tanh and softmax: When using softmax, the connections can keep on improving the chance of their desired output just by making their own weights bigger. In fact since I just used linear math in my explanation above and didn’t need to run tanh() on anything, couldn’t softmax have learned those weighs even without using a tanh layer? In theory it could, but in practice it will keep on bumping up the numbers to get small improvements and you will very quickly overflow floating point numbers. The tanh layer in the middle is then just responsible for keeping the numbers small: it clamps its outputs to the range -1 to 1, and the inputs won’t grow past a certain point either because at some point a bigger number just means that the output goes from 0.995 to 0.997. But since they can usually still get a small improvement you don’t lose that nice property of softmax where neurons can keep on edging out small improvements over each other.</p><p>So if you just use softmax your weights will explode and if you just use tanh your weights will stagnate too soon before a good solution emerges. If you use both you get nice greedy behavior where the connections keep on looking for better solutions, but you also keep the weights from exploding.</p><p>In demonstrating my network’s capability to learn the rule that associates input neuron n with firing output neuron n+1, it becomes apparent that by shuffling the weights in various permutations, I can instruct the network to link any input neuron x to any other output neuron y. What stands out as particularly impressive is that, without the inclusion of a middle layer, I would have required 121 connections (11<em>11) to enable the network to learn any combination. However, with the addition of the middle layer, achieving the same flexibility is achievable with just 44 connections (11</em>2*2). This underscores the efficiency and power of introducing intermediary nodes in the neural network architecture.</p><p>When working with two nodes in the middle layer, the capacity to handle complex patterns is limited, reaching its threshold around eleven inputs and outputs. Beyond this point, the weights tend to fluctuate, leading to interference among them. However, introducing a third node in the middle layer expands the network’s capabilities, allowing it to learn patterns for approximately thirty inputs and outputs. With four nodes, the network can even accommodate direct connections for over a hundred inputs and outputs. It’s important to note that this growth isn’t strictly linear because the number of possible combinations doesn’t follow a linear progression. Fortunately, the backpropagation algorithm scales with the number of connections rather than the number of combinations. This results in a computational cost that increases linearly while the network’s capacity for learning expands in a super-linear fashion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XLGKKifAh0fGNi4M1oVC0w.jpeg" /></figure><p><strong>OUTLOOK AND CONCLUSION:</strong></p><p>As I delve into the realm of neural networks, I find that real-world examples are significantly more intricate than my initial simple models. In contemporary networks, the number of neurons often extends into the hundreds, making it challenging to gain a clear understanding of what the network has truly learned. Visualization becomes more complex; even in smaller networks with around eleven neurons, comprehending the significance of each connection proves difficult. When dealing with a middle layer boasting 700 neurons, the task of discerning crucial connections becomes even more formidable. It’s not as straightforward as isolating strong connections; the weaker links also play a vital role. It’s plausible that a multitude of feeble connections collaboratively contribute to shaping the desired output, while a solitary robust connection might unexpectedly suppress undesired outcomes. This complexity underscores the intricate nature of neural networks and the need for nuanced understanding beyond a simplistic visual representation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=085b2c25e872" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>