Knowledge Graph
Tìm hiểu cách knowledge graph tổ chức các thực thể và mối quan hệ trong thế giới thực cho AI. Khám phá cách sử dụng Ultralytics YOLO26 để trích xuất các node và nâng cao các model ML.
A knowledge graph is a structured representation of real-world entities and the relationships between them. Unlike a standard database that stores data in rigid rows and columns, a knowledge graph organizes information as a network of nodes (representing objects, people, or concepts) and edges (representing the connections or interactions between those nodes). This structure mimics how humans organize information, allowing artificial intelligence (AI) systems to understand context, infer new facts, and reason about data in a more semantic and interconnected way.
Tìm hiểu cấu trúc#
Tại cốt lõi của một đồ thị tri thức là ba thành phần chính tạo thành các "bộ ba" (Chủ ngữ-Vị ngữ-Tân ngữ):
- Nút (Thực thể): Đây là các điểm dữ liệu riêng biệt, chẳng hạn như "London", "Python" hoặc "Ultralytics YOLO26". Trong các tác vụ thị giác máy tính, chúng có thể đại diện cho các đối tượng được phát hiện như "Ô tô" hoặc "Người đi bộ".
- Cạnh (Mối quan hệ): Những đường kẻ riêng biệt này kết nối các nút và xác định cách chúng liên quan với nhau. Ví dụ, một cạnh có thể gắn nhãn mối quan hệ giữa "London" và "UK" là "là_thủ_đô_của".
- Attributes (Properties): Additional details describing a node, such as the population of a city or the confidence score of an object detection.
This web-like structure enables systems to perform semantic search, where the engine understands the user's intent rather than just matching keywords. For example, knowing that "Jaguar" is both an animal and a car brand allows the system to differentiate results based on context.
Tích hợp với Machine Learning#
Knowledge graphs are increasingly vital for enhancing machine learning (ML) models. While deep learning models excel at statistical pattern recognition, they often lack factual grounding. Integrating a knowledge graph allows models to access a verified "world view."
- Retrieval-Augmented Generation (RAG): Generative models can sometimes produce plausible but incorrect information. By grounding Large Language Models (LLMs) with a knowledge graph, AI agents can query a verified source of truth before generating a response. This significantly reduces hallucinations in LLMs and improves factual accuracy for enterprise applications.
- Recommendation Systems: In AI in retail, graphs map complex relationships between users and products. If a customer purchases a camera, the graph understands the functional link to "SD Cards" or "Tripods," enabling smarter suggestions than simple collaborative filtering.
Ví dụ mã: Trích xuất thực thể cho đồ thị#
Computer vision models act as excellent entry points for populating knowledge graphs by identifying physical entities in the real world. The following Python snippet demonstrates how to use the Ultralytics YOLO26 model to detect objects in an image. These detected classes can act as nodes, which can then be linked in a graph database (like Neo4j or Amazon Neptune).
from ultralytics import YOLO
# Load the latest YOLO26 model (released Jan 2026)
model = YOLO("yolo26n.pt")
# Run inference on an image to find entities
results = model("https://ultralytics.com/images/bus.jpg")
# Extract unique detected object names to serve as graph nodes
# e.g., {'bus', 'person'}
detected_entities = {results[0].names[int(c)] for c in results[0].boxes.cls}
print(f"Graph Nodes: {detected_entities}")Các ứng dụng trong thực tế#
-
Drug Discovery in Healthcare: Researchers in AI in healthcare utilize knowledge graphs to model biological interactions. By linking entities such as genes, proteins, and chemical compounds from databases like UniProt, algorithms can predict potential drug targets and side effects, accelerating the development of new treatments.
-
Supply Chain Digital Twins: Logistics companies employ knowledge graphs to create a "digital twin" of their operations. Nodes represent suppliers, warehouses, and inventory, while edges represent shipping routes and dependencies. This structure facilitates Big Data analytics, allowing managers to predict delays and optimize routes dynamically.
Đồ thị tri thức so với cơ sở dữ liệu quan hệ#
Điều quan trọng là phải phân biệt đồ thị tri thức với Cơ sở dữ liệu quan hệ (RDBMS) truyền thống. Cơ sở dữ liệu quan hệ lưu trữ dữ liệu trong các bảng cứng nhắc được liên kết bằng khóa ngoại, điều này hiệu quả cho dữ liệu giao dịch có cấu trúc (như sổ cái ngân hàng). Tuy nhiên, việc truy vấn các mối quan hệ phức tạp (ví dụ: "Tìm bạn của bạn bè thích khoa học viễn tưởng") đòi hỏi các thao tác "join" đắt đỏ.
In contrast, a knowledge graph (often stored in a Graph Database) treats the relationship as a first-class citizen. Traversing connections is instantaneous, making graphs superior for tasks involving highly interconnected data, such as fraud detection rings or social network analysis. While RDBMS excels at storage and retrieval of specific records, knowledge graphs excel at discovering patterns and hidden insights within the connections themselves.
Triển vọng tương lai với AI đa phương thức (Multi-Modal AI)#
The future of knowledge graphs lies in multi-modal learning. As models like Ultralytics YOLO26 continue to advance in object detection and pose estimation, they will automatically feed visual context into graphs. This creates systems that not only "read" text but "see" the world, linking visual concepts to linguistic definitions. Using the Ultralytics Platform, developers can train these specialized vision models to recognize custom entities, effectively building the sensory organs for the next generation of knowledge-aware AI systems.






