Yolo Tầm nhìn Thâm Quyến
Thâm Quyến
Tham gia ngay
Bảng chú giải thuật ngữ

SiLU (Sigmoid Linear Unit)

Khám phá cách hàm kích hoạt SiLU (Swish) tăng cường hiệu suất học sâu trong các tác vụ AI như phát hiện đối tượng và NLP.

The Sigmoid Linear Unit, commonly referred to as SiLU, is a highly effective activation function used in modern deep learning architectures to introduce non-linearity into neural networks. By determining how neurons process and pass information through the layers of a model, SiLU enables systems to learn complex patterns in data, functioning as a smoother and more sophisticated alternative to traditional step functions. Often associated with the term "Swish" from initial research on automated activation search, SiLU has become a standard in high-performance computer vision models, including the state-of-the-art YOLO26 architecture.

Hàm SiLU Hoạt Động Như Thế Nào

At its core, the SiLU function operates by multiplying an input value by its own Sigmoid transformation. Unlike simple threshold functions that abruptly switch a neuron between "on" and "off," SiLU provides a smooth curve that allows for more nuanced signal processing. This mathematical structure creates distinct characteristics that benefit the model training process:

  • Tính trơn tru: Đường cong liên tục và khả vi ở mọi điểm. Thuộc tính này hỗ trợ các thuật toán tối ưu hóa như gradient descent bằng cách cung cấp một "bề mặt" nhất quán để điều chỉnh trọng số mô hình , điều này thường dẫn đến sự hội tụ nhanh hơn trong quá trình huấn luyện.
  • Non-Monotonicity: Unlike standard linear units, SiLU is non-monotonic, meaning its output can decrease even as the input increases in certain negative ranges. This allows the network to capture complex features and retain negative values that might otherwise be discarded, helping to prevent the vanishing gradient problem in deep networks.
  • Tự điều chỉnh cổng: SiLU hoạt động như một cổng riêng, điều chỉnh lượng tín hiệu đầu vào đi qua dựa trên chính độ lớn của tín hiệu đầu vào. Điều này mô phỏng các cơ chế điều chỉnh cổng được tìm thấy trong mạng bộ nhớ dài hạn ngắn hạn (LSTM) nhưng ở dạng hiệu quả về mặt tính toán, phù hợp với mạng nơ-ron tích chập (CNN) .

Các Ứng dụng Thực tế

SiLU là một phần không thể thiếu của nhiều giải pháp AI tiên tiến, nơi độ chính xác và hiệu quả là tối quan trọng.

  • Autonomous Vehicle Perception: In the safety-critical domain of autonomous vehicles, perception systems must identify pedestrians, traffic signs, and obstacles instantly. Models utilizing SiLU in their backbones can maintain high inference speeds while accurately performing object detection in varying lighting conditions, ensuring the vehicle reacts safely to its environment.
  • Medical Imaging Diagnostics: In medical image analysis, neural networks need to discern subtle texture differences in MRI or CT scans. The gradient-preserving nature of SiLU helps these networks learn the fine-grained details necessary for early tumor detection, significantly improving the reliability of automated diagnostic tools used by radiologists.

So sánh với các khái niệm liên quan

Để hiểu rõ hơn về SiLU, cần phân biệt nó với các chức năng kích hoạt khác được tìm thấy trong thuật ngữ Ultralytics .

  • SiLU vs. ReLU (Rectified Linear Unit): ReLU is famous for its speed and simplicity, outputting zero for all negative inputs. While efficient, this can lead to "dead neurons" that stop learning. SiLU avoids this by allowing a small, non-linear gradient to flow through negative values, which often results in better accuracy for deep architectures trained on the Ultralytics Platform.
  • SiLU vs. GELU (Gaussian Error Linear Unit): These two functions are visually and functionally similar. GELU is the standard for Transformer models like BERT and GPT, while SiLU is frequently preferred for computer vision (CV) tasks and CNN-based object detectors.
  • SiLU so với Sigmoid : Mặc dù SiLU sử dụng hàm Sigmoid bên trong, nhưng chúng đóng vai trò khác nhau. Sigmoid thường được sử dụng trong lớp đầu ra cuối cùng cho phân loại nhị phân để biểu diễn xác suất, trong khi SiLU được sử dụng trong các lớp ẩn để hỗ trợ trích xuất đặc trưng.

Ví dụ triển khai

You can visualize how different activation functions transform data using the PyTorch library. The following code snippet demonstrates the difference between ReLU (which zeroes out negatives) and SiLU (which allows smooth negative flow).

import torch
import torch.nn as nn

# Input data: negative, zero, and positive values
data = torch.tensor([-2.0, 0.0, 2.0])

# Apply ReLU: Negatives become 0, positives stay unchanged
relu_out = nn.ReLU()(data)
print(f"ReLU: {relu_out}")
# Output: tensor([0., 0., 2.])

# Apply SiLU: Smooth curve, small negative value retained
silu_out = nn.SiLU()(data)
print(f"SiLU: {silu_out}")
# Output: tensor([-0.2384,  0.0000,  1.7616])

By retaining information in negative values and providing a smooth gradient, SiLU plays a pivotal role in the success of modern neural networks. Its adoption in architectures like YOLO26 underscores its importance in achieving state-of-the-art performance across diverse computer vision tasks.

Tham gia Ultralytics cộng đồng

Tham gia vào tương lai của AI. Kết nối, hợp tác và phát triển cùng với những nhà đổi mới toàn cầu

Tham gia ngay