คู่มือ AI แบบเห็นภาพ

สถาปัตยกรรมยูเน็ต

U-Net คือโครงข่ายประสาทเทียมแบบคอนโวลูชันที่มีรูปร่างเหมือนตัวอักษร U โดยตัวเข้ารหัส (encoder) จะย่อขนาดภาพเพื่อจับบริบท และตัวถอดรหัส (decoder) จะขยายภาพกลับสู่ความละเอียดเต็มรูปแบบ พร้อมทั้งมีการเชื่อมต่อแบบข้าม (skip connections) เพื่อคัดลอกรายละเอียดที่ละเอียดอ่อนข้ามไปยังอีกฝั่ง

ฟังคำแนะนำนี้บรรยายโดย AI · ~8 min

บนหน้านี้อ่าน 9 นาที
  1. ภาพรวม
  2. ประเด็นสำคัญ
  3. เจาะลึก
  4. การติดตามภาพหนึ่งภาพผ่าน U-Net ขนาดเล็ก
  5. การใช้งานจริงในโลกแห่งความเป็นจริง
  6. อนาคตของสถาปัตยกรรม U-Net
  7. การนำไปปฏิบัติ
  8. ที่มาและอ่านเพิ่มเติม
  9. สำรวจต่อไป
  10. คำถามที่พบบ่อย

ภาพรวม

เปิดตัวในปี 2015 สำหรับการแบ่งส่วนภาพทางชีวการแพทย์ที่มีภาพที่ระบุข้อมูลกำกับไว้น้อยมาก มันได้กลายเป็นดีไซน์มาตรฐานสำหรับการแบ่งส่วนภาพทางการแพทย์และเป็นแกนหลักในการลดสัญญาณรบกวนของเครื่องสร้างภาพแบบแพร่ (diffusion image generators) เช่น Stable Diffusion

ประเด็นสำคัญ

  1. U-Net จับคู่ตัวเข้ารหัสแบบลดขนาด (downsampling encoder) กับตัวถอดรหัสแบบเพิ่มขนาด (upsampling encoder) และเชื่อมต่อเข้าด้วยกันด้วย skip connections ที่ส่งผ่านรายละเอียดเชิงพื้นที่ที่ละเอียดอ่อนไปให้
  2. Ronneberger, Fischer และ Brox ได้เปิดตัว U-Net ที่งาน MICCAI 2015 และฝึกฝนมันด้วยภาพถ่ายจากกล้องจุลทรรศน์ที่มีการระบุข้อมูลกำกับไว้เพียง 30 ภาพ โดยใช้การเพิ่มข้อมูลด้วยการบิดเบี้ยวแบบยืดหยุ่น (elastic deformation augmentation)
  3. โครงข่ายต้นฉบับมีเลเยอร์คอนโวลูชัน 23 เลเยอร์ ไม่มีเลเยอร์แบบเชื่อมต่อเต็มรูปแบบ (fully connected layers) และสามารถแบ่งส่วนภาพขนาด 512 คูณ 512 ได้ในเวลาไม่ถึงหนึ่งวินาทีบน GPU
  4. nnU-Net กำหนดค่า U-Net แบบปกติโดยอัตโนมัติ และสร้างมาตรฐานใหม่ให้กับงานแบ่งส่วนภาพ 29 จาก 49 งานในการแข่งขัน โดยไม่ต้องปรับแต่งด้วยตนเอง
  5. เครื่องสร้างภาพแบบแพร่ รวมถึง DDPM และ Latent Diffusion ซึ่งเป็นพื้นฐานของ Stable Diffusion ใช้ U-Net ที่ปรับตามเวลา (time-conditioned U-Net) เพื่อทำนายสัญญาณรบกวนในแต่ละขั้นตอน

เจาะลึก

U-Net is a neural network design for tasks where the output is an image the same size as the input, such as labeling every pixel of a scan as tumor or healthy tissue. That task is called semantic segmentation. Ordinary image classifiers squeeze a picture down into a single label and throw away where things are. U-Net keeps the location information by pairing a shrinking path with an expanding path and wiring the two together, so the network can answer both "what is this" and "exactly where is it" for every pixel.

The mechanism works in three parts. The contracting path, or encoder, repeatedly applies two 3 by 3 convolutions (small learned filters that slide over the image), each followed by a ReLU activation, then a 2 by 2 max-pooling step that halves the width and height. After each downsampling step the number of feature channels doubles, from 64 up to 1,024 in the original paper. The expanding path, or decoder, reverses this: it upsamples the feature map, applies a 2 by 2 "up-convolution" that halves the channels, then concatenates the matching feature map from the encoder before two more 3 by 3 convolutions. Those concatenations are the skip connections. They hand the decoder the sharp, high-resolution detail the encoder saw before pooling blurred it. A final 1 by 1 convolution maps each 64-channel pixel vector to class scores. The original network has 23 convolutional layers and no fully connected layers.

U-Net was published by Olaf Ronneberger, Philipp Fischer and Thomas Brox of the University of Freiburg at MICCAI 2015, with the arXiv preprint posted in May 2015. It built on the fully convolutional network idea but added a decoder nearly as wide as the encoder, producing the symmetric U shape. Because the original used unpadded convolutions, a 572 by 572 input tile produced a 388 by 388 output map. To segment images larger than GPU memory allowed, the authors used an overlap-tile strategy: predict one tile at a time and fill in the missing context at the image borders by mirroring the input.

The paper's other contribution was a training recipe for tiny datasets. The authors applied random elastic deformations, built from displacement vectors on a coarse 3 by 3 grid with a 10-pixel standard deviation, so the network learned invariance to the kinds of warping common in tissue. They also introduced a pixel-wise loss weight map that forces the network to learn the thin borders between touching cells. Results were strong for the time: on the ISBI 2012 electron microscopy challenge, trained on 30 images, U-Net achieved a warping error of 0.0003529, a new best, against 0.000420 for the prior sliding-window network. On the 2015 cell tracking challenge it scored 77.5% IoU on DIC HeLa cells, where the runner-up scored 46%. Training took about 10 hours on an Nvidia Titan GPU with 6 GB of memory, and segmenting a 512 by 512 image took under a second.

The design spread in two directions. In medical imaging, a 3D version followed in 2016, and the nnU-Net framework by Fabian Isensee and colleagues (preprint 2019, later published in Nature Methods) showed that careful automatic configuration of a plain U-Net matters more than architectural novelty. Applied to 19 datasets and 49 tasks from international challenges, nnU-Net set a new state of the art on 29 of 49 target structures. The authors also observed that the top 15 entries in the KiTS 2019 kidney tumor challenge were all descendants of the 3D U-Net. In generative AI, Jonathan Ho and colleagues used a U-Net with self-attention as the noise predictor in Denoising Diffusion Probabilistic Models (2020), and Robin Rombach and colleagues ran a time-conditional U-Net inside a compressed latent space in Latent Diffusion Models (CVPR 2022), the work behind Stable Diffusion. The LDM paper credits the U-Net's spatial inductive bias as one reason diffusion models suit image data.

Compared with alternatives, U-Net sits between classic sliding-window classifiers and newer transformer models. Sliding-window networks classify each pixel from a patch around it, which is slow because overlapping patches are recomputed and forces a trade-off between context and localization; the U-Net paper names both drawbacks. The fully convolutional networks of Long and colleagues (2014), which U-Net extends, already replaced pooling with upsampling layers; U-Net's change was to give the upsampling path a large number of feature channels so context reaches the high-resolution layers. Vision transformers and hybrid designs model long-range relationships through attention, and in image generation the Diffusion Transformer (DiT) of William Peebles and Saining Xie (2022) replaced the U-Net backbone entirely, reaching an FID of 2.27 on 256 by 256 ImageNet. In medical segmentation, the nnU-Net results suggest a well-tuned convolutional U-Net remains a hard baseline to beat.

U-Net has known failure modes. Its receptive field, the region of the input that influences one output pixel, is limited by depth, so it can miss global context such as which side of the body an organ is on. Skip connections can pass texture straight through, which helps detail but can also copy noise or artifacts. Performance depends heavily on preprocessing, patch size, normalization and loss choice; nnU-Net exists precisely because these settings are hard to get right by hand. Like any supervised segmenter, it inherits label errors, and models trained on one scanner or hospital can degrade on another. Memory grows quickly for 3D volumes, which is why patch-based training and tiling are standard.

In practice a 2D U-Net trains on a single consumer GPU, and the original needed only tens of labeled images thanks to heavy augmentation. Typical implementations today add padding so outputs match input size, use batch or group normalization, and train with Dice loss or cross-entropy. For 3D clinical data, nnU-Net automates the choice of patch size, network depth, batch size and post-processing based on the dataset's properties and the available GPU memory.

04ตัวอย่างการทำงาน

การติดตามภาพหนึ่งภาพผ่าน U-Net ขนาดเล็ก

  1. Start with a 256 by 256 grayscale scan and a target mask that marks each pixel as organ or background.

  2. Encoder level 1 applies two padded 3 by 3 convolutions with 64 filters and saves the 256 by 256 by 64 result for a skip connection, then max-pools to 128 by 128.

  3. Repeat for levels 2 to 4 with 128, 256 and 512 filters, saving each output, until a 16 by 16 by 1,024 bottleneck holds coarse context.

  4. In the decoder, upsample to 32 by 32, halve channels to 512, concatenate the saved level 4 features, and apply two 3 by 3 convolutions.

  5. Repeat upward until the map is 256 by 256 by 64, then apply a 1 by 1 convolution to produce two class scores per pixel.

  6. Compute per-pixel cross-entropy or Dice loss against the mask and backpropagate through both paths.

มันแสดงให้เห็นอะไร

The output is a 256 by 256 probability map the same size as the input. Check it by thresholding at 0.5 and computing the Dice coefficient against held-out masks; removing the skip connections should visibly blur organ boundaries and lower the score.

การใช้งานจริงในโลกแห่งความเป็นจริง

The original 2015 U-Net segmented neuronal membranes in electron microscopy images for the ISBI 2012 challenge, training on only 30 annotated 512 by 512 images and setting a new best warping error.

On the ISBI 2015 cell tracking challenge, U-Net reached 92% intersection over union on phase-contrast glioblastoma cells, against 83% for the second-best method.

nnU-Net, a self-configuring U-Net framework from the German Cancer Research Center, was applied without manual tuning to 49 segmentation tasks covering organs, tumors and lesions in CT and MRI scans.

Denoising Diffusion Probabilistic Models (2020) used a U-Net with self-attention to predict noise at each step, producing CIFAR-10 images with an FID of 3.17.

Latent Diffusion Models, the research behind Stable Diffusion, run a time-conditional U-Net in a compressed latent space and inject text prompts through cross-attention layers inside the U-Net.

อนาคตของสถาปัตยกรรม U-Net

Two research threads shape the U-Net's future. In medical imaging, the 2019 nnU-Net study argued that pipeline configuration explains more of the performance gap than new architectural modules, and later work continues to test transformer and state-space blocks against tuned convolutional U-Nets. Whether those additions give consistent gains across datasets, rather than on single benchmarks, is an open question that challenge leaderboards keep probing. In image generation, the backbone is shifting. The Diffusion Transformer paper (Peebles and Xie, December 2022) showed that replacing the U-Net with a transformer over latent patches scales predictably with compute, reaching an FID of 2.27 on 256 by 256 ImageNet. Transformer backbones are now an active alternative in research, while the U-Net-based Latent Diffusion design from 2021 to 2022 remains widely used and studied, especially in open-source tools. Open problems include capturing global context without losing the U-Net's efficiency, segmenting reliably across scanners and hospitals, reducing the labeled data needed for 3D volumes, and quantifying uncertainty so clinicians know when a segmentation should not be trusted.

การนำไปปฏิบัติ

ทำไมมันถึงสำคัญ

  • ความเร็วและขนาด. Visual AI สามารถทำให้การตรวจสอบ การตรวจจับ และการแท็กเป็นอัตโนมัติในขนาดต่างๆ
  • สร้างทางเลือก. ทีมสร้างสรรค์สามารถสร้างต้นแบบแนวคิดได้รวดเร็วขึ้นโดยต้องมีการแก้ไขด้วยตนเองน้อยลง
  • ทีมงานและขั้นตอนการทำงาน. การดำเนินการสามารถใช้สัญญาณภาพและวิดีโอที่ก่อนหน้านี้ประมวลผลได้ยาก

ระวัง

  • สิทธิ์และความยินยอมในรูปภาพอาจกลายเป็นความเสี่ยงทางกฎหมายได้หากแหล่งที่มาไม่ชัดเจน
  • ประสิทธิภาพของโมเดลอาจแตกต่างกันไปตามสภาพแสง ข้อมูลประชากร และสภาพแวดล้อม
  • ผลบวกลวงอาจไม่สังเกตเห็นเว้นแต่จะมีการตรวจสอบเกณฑ์ความเชื่อมั่น

ขั้นตอนต่อไป

  1. กำหนดเกณฑ์การยอมรับสำหรับความแม่นยำ การเรียกคืน และต้นทุนข้อผิดพลาด
  2. ทดสอบด้วยข้อมูลที่ตรงกับเงื่อนไขการผลิตจริง
  3. เพิ่มการตรวจสอบโดยเจ้าหน้าที่สำหรับการคาดการณ์ที่มีความมั่นใจต่ำหรือมีผลกระทบสูง
  4. ติดตามการเคลื่อนตัวของโมเดลและตรวจสอบความถูกต้องอีกครั้งหลังจากการเปลี่ยนแปลงกล้องหรือชุดข้อมูล

ที่มาและอ่านเพิ่มเติม

  1. arXiv (MICCAI 2015)U-Net: Convolutional Networks for Biomedical Image Segmentation
  2. arXiv (Nature Methods 2021)Automated Design of Deep Learning Methods for Biomedical Image Segmentation (nnU-Net)
  3. arXiv (NeurIPS 2020)แบบจำลองความน่าจะเป็นแบบกระจายสัญญาณรบกวน
  4. arXiv (CVPR 2022)การสังเคราะห์ภาพความละเอียดสูงด้วยแบบจำลองการแพร่กระจายแฝง
  5. arXivScalable Diffusion Models with Transformers

สำรวจต่อไป

จดหมายข่าวฟรี

รับสรุป AI รายวัน

เรื่องราว AI ที่ตรวจสอบแล้ว 3 เรื่องทุกวันทำงาน เช้า, เขียนเป็นภาษาอังกฤษธรรมดา ฟรีตลอดไป ไม่มีโฆษณา

อีเมลหนึ่งฉบับทุกวันทำงาน ยกเลิกการสมัครในคลิกเดียว เราไม่เคยขายหรือแชร์ที่อยู่อีเมลของคุณ

ทดสอบตัวเอง

Take the U-Net Architecture quiz

ข้อเสนอแนะทันทีสำหรับทุกคำตอบ และใบรับรองที่สามารถแชร์ได้พร้อม ID ที่ตรวจสอบได้เมื่อคุณผ่านหลักสูตร

เริ่มแบบทดสอบ

สนับสนุนการศึกษา AI ฟรี AI Understanding เป็นองค์กรไม่แสวงหาผลกำไร 501(c)(3) — ไม่มีโฆษณา ไม่มีกำแพงเงิน, ตลอดไป บริจาค

คำถามที่พบบ่อย

สถาปัตยกรรม U-Net คืออะไร?

U-Net is a convolutional neural network shaped like the letter U: an encoder shrinks an image to capture context, a decoder expands it back to full resolution, and skip connections copy fine detail across. Introduced in 2015 for biomedical segmentation with very few labeled images, it became the default design for medical image segmentation and the denoising backbone of diffusion image generators such as Stable Diffusion.

อะไรทำให้ U-Net มีรูปร่างเป็น 'U'

ตัวเข้ารหัสแบบหดตัวและตัวถอดรหัสส่วนขยายแบบสมมาตรจะสร้างแขนทั้งสองของ 'U'

จุดประสงค์ของการเชื่อมต่อแบบข้ามของ U-Net คืออะไร?

ข้ามการเชื่อมต่อโดยเชื่อมแผนผังคุณลักษณะของตัวเข้ารหัสเข้ากับตัวถอดรหัส เพื่อเรียกคืนรายละเอียดเชิงพื้นที่ที่แม่นยำที่สูญเสียไประหว่างการสุ่มตัวอย่าง

U-Net เดิมออกแบบมาเพื่ออะไร

Ronneberger และเพื่อนร่วมงานเปิดตัว U-Net ในปี 2558 สำหรับการแบ่งส่วนภาพทางชีวการแพทย์ ซึ่งทำงานได้ดีกับภาพที่ติดป้ายกำกับเพียงไม่กี่ภาพ

ใน Stable Diffusion U-Net ทำนายอะไรในแต่ละขั้นตอน

U-Net การแพร่กระจายได้รับการฝึกฝนให้คาดการณ์สัญญาณรบกวนที่เพิ่มเข้าไปในค่าแฝง เพื่อให้สามารถลบออกได้ และค่อยๆ ลดสัญญาณรบกวนไปทางภาพ

จะเกิดอะไรขึ้นกับข้อมูลเชิงพื้นที่เมื่อดาวน์สุ่มตัวอย่างตัวเข้ารหัส

การสุ่มตัวอย่างต่ำจะสร้างคุณลักษณะเชิงความหมายระดับสูงในขณะที่เบลอการแปลเชิงพื้นที่ที่แน่นอน ซึ่งจะข้ามการเชื่อมต่อในภายหลังเพื่อช่วยในการกู้คืน

เรียนรู้ต่อไป

คำแนะนำที่เกี่ยวข้อง

คำแนะนำเพิ่มเติมที่เลือกสำหรับหัวข้อนี้

รับใบรับรอง AI ฟรีหลักสูตรและการสอบสั้น ๆ ฟรี ไม่มีค่าใช้จ่าย ไม่มีบัตรเครดิต ประมาณ 2.5 ชั่วโมงเริ่มต้นฟรี →