惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Security Archives - TechRepublic
Security Archives - TechRepublic
罗磊的独立博客
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
Apple Machine Learning Research
Apple Machine Learning Research
The Register - Security
The Register - Security
J
Java Code Geeks
V2EX - 技术
V2EX - 技术
Vercel News
Vercel News
N
News and Events Feed by Topic
腾讯CDC
P
Proofpoint News Feed
N
News | PayPal Newsroom
www.infosecurity-magazine.com
www.infosecurity-magazine.com
爱范儿
爱范儿
O
OpenAI News
酷 壳 – CoolShell
酷 壳 – CoolShell
月光博客
月光博客
Martin Fowler
Martin Fowler
Engineering at Meta
Engineering at Meta
D
Docker
Y
Y Combinator Blog
博客园 - 聂微东
G
Google Developers Blog
S
Security @ Cisco Blogs
Simon Willison's Weblog
Simon Willison's Weblog
S
Schneier on Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
SegmentFault 最新的问题
云风的 BLOG
云风的 BLOG
阮一峰的网络日志
阮一峰的网络日志
C
CXSECURITY Database RSS Feed - CXSecurity.com
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
CERT Recently Published Vulnerability Notes
I
Intezer
G
GRAHAM CLULEY
有赞技术团队
有赞技术团队
Attack and Defense Labs
Attack and Defense Labs
V
Visual Studio Blog
博客园 - Franky
博客园 - 三生石上(FineUI控件)
W
WeLiveSecurity
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Hugging Face - Blog
Hugging Face - Blog
Scott Helme
Scott Helme
T
Troy Hunt's Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
L
LINUX DO - 最新话题
C
Cybersecurity and Infrastructure Security Agency CISA

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Autoencoders and Representation Learning in Vision
Emmanuel Chi · 2026-04-22 · via DEV Community

Autoencoders are a type of neural network that compress data into a lower-dimensional space and then reconstruct the original input from that compressed representation.

If you've ever encountered Principal Component Analysis (PCA), then you already have an intuition for how this works. The key difference is that PCA is a linear projection method, while autoencoders use neural networks, allowing them to learn non-linear structure in the data.

In theory, a linear autoencoder with a single hidden layer behaves similarly to PCA in 1-D. But once we introduce depth and non-linearity, the model begins to learn richer representations that go far beyond linear subspaces.


How does the Autoencoder work?

The Autoencoder follows a two-stage component design.

1. The Encoder

The encoder is the first component of the autoencoder. It compresses the input data by projecting it into a lower-dimensional latent space.

The objective is to extract the most informative features required to represent the original data efficiently, while discarding redundancy and noise.

Formally:

z=fθ(x) z = f_{\theta}(x)

Where:

  • xx = input data
  • fθf_{\theta} = encoder network (parameterized by θ\theta )
  • zz = latent representation

This is analogous to PCA in the linear case, where the model projects data onto principal components. However, unlike PCA, the encoder learns non-linear representions.

2. The Decoder

The decoder is the second component of the autoencoder. It reconstructs the original input from the compressed latent representation.

x^=gϕ(z) \hat{x} = g_{\phi}(z)

Where:

  • gϕg_{\phi} = decoder network
  • x^\hat{x} = reconstructed output

The full pipeline becomes:

x^=gϕ(fθ(x)) \hat{x} = g_{\phi}(f_{\theta}(x))

The goal of the autoencoder is to minimize the reconstruction error:

L=xx^22 \mathcal{L} = | x - \hat{x} |_2^2

So the model is explicitly trained to preserve information needed for reconstruction while discarding everything else.

import torch
import torch.nn as nn
import torch.nn.functional as F

class TinyAE(nn.Module):
    def __init__(self):
        super().__init__()
        self.enc = nn.Sequential(
            nn.Linear(784, 256),
            nn.ReLU(),
            nn.Linear(256, 64)
        )
        self.dec = nn.Sequential(
            nn.Linear(64, 256),
            nn.ReLU(),
            nn.Linear(256, 784),
            nn.Sigmoid()
        )

    def forward(self, x):
        z = self.enc(x)
        return self.dec(z)

model = TinyAE()
opt = torch.optim.Adam(model.parameters(), 1e-3)

for step in range(500):
    x = torch.rand(16, 784)

    recon = model(x)
    loss = F.mse_loss(recon, x)

    opt.zero_grad()
    loss.backward()
    opt.step()

    if step % 100 == 0:
        print(step, loss.item())

Enter fullscreen mode Exit fullscreen mode

What is Representation Learning?

Oftentimes in computer vision, we want to know what kind of internal structure a model learns about the world when it is forced to predict missing information. This type of task is called representation learning. To answer this question, Engineers use different types of self-supervised learning techniques. The different types of answers determine whether a model learns textures, true semantics or local continuity. This is important especially for fields like medical imaging where meaning is not encoded in pixels but in 3D configurations of the anatomy of animal bodies
At a technical level, representation learning asks

What structure does the latent space (z) actually encode about the input?

Formally:

z=fθ(x) z = f_\theta(x)

We want (z) to:

  • discard noise
  • preserve semantic structure
  • generalize to downstream tasks (segmentation, detection, classification)

All reconstruction-based methods share this same task: reconstruct what is missing from the inputs, but the nature of what is missing completely changes the learning dynamics.

To understand this better, let us take a look at three important concepts.

Three Levels of Reconstruction Difficulty

1. Naive reconstruction (identity learning)

Here, the model reconstructs the full input to output. If nothing is removed from the input, and only compression takes place, can the model reconstruct the full output with minimal error? This is the trivial case of representation learning called compresion of identity.

fθ(x)x f_\theta(x) \approx x

The typical behaviour to expect is simple. The model learns an identity mapping and memorizes the relationships between different pixels. It does not learn any abstraction.
This is not exactly representation learning. It is compression without constraint.

2. Random masking (weak structure learning)

In Random masking, we remove independent pixels from the image data and ask the model to rebuild the image with those missing pixels intact. This forces interpolation, allowing the model to substitute the values using the neighboring pixel data. This allows the model to learn local texture, smoothing and short-range continuity.

xmasked=xm,mBernoulli(p) x_{masked} = x \odot m, \quad m \sim \text{Bernoulli}(p)

The idea is that each pixel is removed independently. This allows the model to use local interpolation to predict or fill-in missing pixel values, enabling texture continuity and short-range correlation. It has limitations. Because missingness is unstructured, the model can rely on:

  • nearby pixels
  • local gradients
  • smoothing priors

So it never needs global reasoning.

3. Block masking (structural reasoning)

Block masking changes the game entirely by removing entire regions instead of points or pixels. The model is then forced to reproduce a missing space from incomplete data. This type of masking is very relevant in medical imaging like CT where pathology is region based and not pixel based.

def block_mask(x, patch=8, ratio=0.5):
    B, C, H, W = x.shape
    mask = torch.zeros_like(x)

    for i in range(0, H, patch):
        for j in range(0, W, patch):
            if torch.rand(1) < ratio:
                mask[:, :, i:i+patch, j:j+patch] = 1

    return x * (1 - mask), mask

Enter fullscreen mode Exit fullscreen mode

The key idea is to remove entire regions. This forces the model to learn about the structure of the objects in a high level. It also allows spatial coherence and global context inference.
This is especially important in CT imaging where:

  • organs are contiguous 3D structures
  • pathology spans regions, not pixels

In our case, the block masking problem is central to this question. To address it, two major families of autoencoders are used:

  1. Masked Autoencoder (MAE)
  2. Denoising Autoencoder (DAE)

1. Denoising Autoencoder (DAE)

The DAE solves this problem by first corrupting the inputs via noise (gaussian white nosie). This means that every pixel is slightly corrupted yet structure is still visible. The issue with our DAE is that it can eaily remove the noise and leave everything unchanged meaning that it didn't really learn to reconstruct the missing parts. It just acted like a complex filter rather than a structure learner.

xnoisy=x+ϵ,ϵN(0,σ2) x_{noisy} = x + \epsilon, \quad \epsilon \sim \mathcal{N}(0, \sigma^2)

What this means

Every pixel is slightly perturbed, but the overall structure of the image remains fully visible. The model then learns to remove noise and recover the original signal. The limitations of this is structural. Because structure is preserved, the model works by smoothing local variations and averaging out noise.

So instead of learning structure, it often behaves like a learned denoising filter.

In other words:

It learns how to clean, not how to understand.

2. Masked Autoencoder (MAE)

The masked autoencoder works by removing information entirely in a process called masking. This implies that large parts of the inputs are completly missing and reconstruction is performed from sparse context.
The Masked Autoencoder removes information completely using a binary mask:

xmasked=x(1m),m0,1p x_{masked} = x \odot (1 - m), \quad m \in {0,1}^p

What this means

Large portions of the input are entirely removed (they are set to zero or omitted).

Unlike DAE,there is no noisy signal and certainly no hint of missing values. The model must then infer missing regions from context alone.

The major objective of the model si to reconstruct missing structure using only partial observations. This forces the model to use global reasoning and structural inference encouraging long-range dependency learning.

Block Masking as the Key Middle Ground

Block masking is a structured version of MAE-style corruption where contiguous regions are removed instead of random pixels.

A simple implementation looks like this:

def block_mask(x, patch=8, ratio=0.5):
    B, C, H, W = x.shape
    mask = torch.zeros_like(x)

    for i in range(0, H, patch):
        for j in range(0, W, patch):
            if torch.rand(1) < ratio:
                mask[:, :, i:i+patch, j:j+patch] = 1

    return x * (1 - mask), mask

Enter fullscreen mode Exit fullscreen mode

Why this matters

Block masking forces the model to:

  • reconstruct missing regions, not pixels
  • infer object-level structure
  • rely on global context

Why MAE beats Denoising Autoencoders

Denoising Autoencoder (DAE)

DAEs corrupt inputs with noise:

xnoisy=x+ϵ,ϵN(0,σ2) x_{noisy} = x + \epsilon, \quad \epsilon \sim \mathcal{N}(0, \sigma^2)

“remove noise but keep everything else unchanged”

So it behaves like a sophisticated smoothing filter.

Masked Autoencoder (MAE)

MAE removes information entirely:

xmasked=x(1m),m0,1p x_{masked} = x \odot (1 - m), \quad m \in {0,1}^p

This brings about true representation learning.

Summary Table

Property DAE MAE
Corruption noise missing regions
Visibility full structure partial structure
Learning signal weak strong
Shortcut learning easy hard
Representation local global

When MAE Fails

Despite its strength, MAE is not universally optimal.

1. Over-masking collapse

If mask ratio is too high the model sees too little context and reconstruction becomes ambiguous. This makes training signals to becomes noisy.

2. Low-resolution or small objects

If the object is small relative to mask blocks, the entire object may be removed and reconstruction becomes guesswork

This is common in lesion detection and micro-structures in CT.

3. Distribution shift sensitivity

MAE learns strong priors about structure.

If test data differs significantly, the learned priors can mislead reconstruction and the model may hallucinate incorrect structure

4. Compute inefficiency (3D case)

In volumetric data, decoder cost scales with full reconstruction space and memory usage becomes a bottleneck

This is why many 3D MAE systems require:

  • patch-based decoding
  • latent-space reconstruction
  • or hybrid CNN-transformer designs

Summary

Autoencoders provide a simple but powerful framework for learning representations without labels. By compressing input data into a latent space and reconstructing it, they force a model to discover what information is essential and what can be discarded.

However, how we formulate the reconstruction task determines what the model learns.

  • Naive reconstruction leads to identity learning: the model memorizes rather than understands.
  • Random masking pushes the model toward local interpolation: learning textures and short-range continuity.
  • Block masking forces true reasoning: the model must infer missing structure from global context.

This is where the distinction between Denoising Autoencoders (DAE) and Masked Autoencoders (MAE) becomes critical:

  • DAE operates under corruption → information is degraded but still present
  • MAE operates under removal → information is absent and must be inferred

Because MAE removes large portions of the input, it creates a higher-uncertainty learning problem, which discourages shortcut solutions and encourages the emergence of semantic, structural representations.

In domains like computer vision and medical imaging, this difference is not just theoretical, it is decisive. Real-world signals (e.g., CT scans) are defined more by spatial relationships and global structure than by local pixel values. MAE aligns naturally with this requirement, making it a stronger foundation for downstream tasks.

That said, MAE is not universally perfect. It can fail when:

  • masking is too aggressive,
  • data lacks global structure,
  • or the decoder becomes too powerful and bypasses the encoder.

Ultimately, the key insight is:

Representation learning is not about reconstruction alone, it is about designing the right information bottleneck.