แมชชีนเลิร์นนิง (ML) เป็นเทคนิคที่มีประสิทธิภาพในการวิเคราะห์ข้อมูลการสังเกตการณ์โลก Earth Engine มีความสามารถในตัวที่ช่วยให้ผู้ใช้สร้างและใช้โมเดล ML สําหรับสถานการณ์ทั่วไปได้ด้วย API ที่ใช้งานง่าย
งาน ML ที่พบบ่อยคือการแยกประเภทพิกเซลในภาพถ่ายดาวเทียมออกเป็น 2 หมวดหมู่ขึ้นไป แนวทางนี้มีประโยชน์สำหรับการแมปการปกคลุมดินและการใช้ที่ดิน ตลอดจนแอปพลิเคชันยอดนิยมอื่นๆ
การแยกประเภทที่มีการควบคุมดูแล: เทคนิค ML อย่างหนึ่งในการแยกประเภทที่ดินคือการใช้ตัวอย่างข้อมูลที่ได้จากการสังเกตการณ์เพื่อสอนโมเดลให้แยกความแตกต่างระหว่างคลาส ตัวแยกประเภทที่มีการควบคุมในตัวของ Earth Engine รองรับกระบวนการนี้
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eEarth Engine provides built-in supervised and unsupervised machine learning APIs for tasks like land cover classification using satellite imagery.\u003c/p\u003e\n"],["\u003cp\u003eFor deep learning, neural networks, or large datasets, training models outside of Earth Engine with frameworks like TensorFlow or PyTorch is recommended.\u003c/p\u003e\n"],["\u003cp\u003eEarth Engine's \u003ccode\u003eee.Model\u003c/code\u003e package enables predictions within Earth Engine using models hosted on Google's Vertex AI.\u003c/p\u003e\n"],["\u003cp\u003eTraining datasets for Earth Engine's built-in classifiers are generally limited to 100 MB, and inference requests are limited to fewer than 400 bands.\u003c/p\u003e\n"],["\u003cp\u003eModel size is limited to 100 MB, but many classifiers offer configuration options to manage complexity and size.\u003c/p\u003e\n"]]],["Earth Engine's Machine Learning (ML) APIs support supervised and unsupervised classification, and regression. For complex tasks like deep learning, train models outside of Earth Engine using frameworks like TensorFlow, exporting data via TFRecord or Apache Beam. For prediction, use `ee.Model` with models hosted on Vertex AI, or external cloud services. Training datasets are generally limited to 100MB (e.g. \u003c200,000 examples with 100 bands) and models to 100MB. Earth Engine processes in 256x256 image tiles, limiting inference requests to fewer than 400 bands.\n"],null,["# Machine Learning in Earth Engine\n\n**Note:** This overview assumes familiarity with basic Machine Learning (ML) concepts like training, prediction and models. The introduction to Machine Learning video on this page provides an introduction to these concepts. Alternatively, please take a look at Google's [Machine Learning Crash Course](https://developers.google.com/machine-learning/crash-course). \n\nMachine Learning APIs\n---------------------\n\n\nMachine Learning (ML) is a powerful technique for analyzing Earth\nObservation data. Earth Engine has built-in capabilities to allow users to\nbuild and use ML models for common scenarios with easy-to-use APIs.\n\n\nA common ML task is to classify the pixels in satellite imagery into two\nor more categories. The approach is useful for Land Use Land Cover mapping\nand other popular applications.\n\n- **Supervised Classification:** One ML technique for classifying land is to use ground truth examples to teach a model to differentiate between classes. Earth Engine's built-in [supervised classifiers](/earth-engine/guides/classification) support this process.\n- **Unsupervised Classification:** In unsupervised classification, no ground truth examples are provided to the training algorithm. Instead, the algorithm divides the available data into clusters based on inherent differences. Earth Engine's [unsupervised classifiers](/earth-engine/guides/clustering) are particularly useful when no ground truth data exists, when you do not know the final number of classes or when you want to do quick experimentation.\n- **Regression:** Whereas a classification model attempts to bucket each input into a discrete class, a regression model attempts to predict a continuous variable for each input. For example, a regression model could predict water quality, percent forest cover, percent cloud cover or crop yield. For more information, please refer to the [Linear Regression section of ee.Reducers](/earth-engine/guides/reducers_regression).\n\nTraining and Prediction outside Earth Engine\n--------------------------------------------\n\n\nDeep learning and neural networks are machine-learning techniques that can\nwork well for complex data like satellite imagery. Neither deep learning\nnor neural networks are supported in Earth Engine's Machine Learning APIs.\nInstead, to take advantage of them, you will need to use a framework like\nTensorFlow or PyTorch and train your model outside of Earth Engine.\n\n\nYou may also want to train outside of Earth Engine if you are already\nfamiliar with a framework like scikit-learn for classical machine learning\nor XGBoost for gradient boosted decision trees.\n\n\nFinally, you may want to train a model outside Earth Engine if your data\nset is very large and exceeds the limits documented below.\n| **Note:** Training and prediction outside of Earth Engine require working with products that may require payment for both commercial and non-commercial use. Additionally, they require knowledge of Google Cloud Platform.\n\n### Exporting Data from Earth Engine for Training\n\n- The [TFRecord data format](/earth-engine/guides/tfrecord) is optimized for training in TensorFlow. The [machine learning examples page includes several TensorFlow workflows](/earth-engine/guides/ml_examples) that demonstrate how to train a model using TFRecords.\n- Alternatively, for an example of how to download data using Apache Beam, hosted in Google Cloud Dataflow, then train in Vertex AI using TensorFlow, please visit the [Land Cover Classification tutorial](https://github.com/GoogleCloudPlatform/python-docs-samples/tree/main/people-and-planet-ai/land-cover-classification) and follow along with a [colab notebook.](https://colab.research.google.com/github/GoogleCloudPlatform/python-docs-samples/blob/main/people-and-planet-ai/land-cover-classification/README.ipynb)\n\n### Getting Predictions from a Model outside Earth Engine\n\n\nIf you train a model outside Earth Engine, you have a few options for\ngetting predictions from that model.\n\n- Earth Engine's `ee.Model` package allows for predictions using data in Earth Engine and a trained model hosted on Google's Vertex AI. You can host your custom trained model in Vertex AI and perform inference directly in Earth Engine using [`ee.Model.fromVertexAi`](/earth-engine/apidocs/ee-model-fromvertexai). See [Connecting to models hosted on Vertex AI](/earth-engine/guides/ee-vertex#connecting-to-models-hosted-on-vertex-ai) for more information.\n- Alternatively, the [Land Cover Classification tutorial](https://github.com/GoogleCloudPlatform/python-docs-samples/tree/main/people-and-planet-ai/land-cover-classification) demonstrates how you can do predictions using a cloud service like Cloud Functions.\n\n### Other Reasons to train models outside Earth Engine\n\n\nIn addition to familiarity and preference, you may want to train a model\noutside Earth Engine if you want to use model architectures (e.g.\nconvolutional neural networks) that are not supported by Earth Engine's\nMachine Learning APIs, if you want to use more features of Vertex AI or if\nyou encounter scaling limits with Earth Engine's Machine Learning APIs.\n\n#### Training Set Limits\n\n\nTraining using `ee.Classifier` or `ee.Clusterer` is\ngenerally effective with datasets up to 100 MB. As a very rough\nguideline, assuming 32-bit (i.e. float) precision, this can accommodate\ntraining datasets that satisfy (where *n* is the number of examples and\n*b* is the number of bands):\n\n\n*nb ≤ (100 \\* 2 ^20^) / 4*\n\n\nAs one example, if you train using 100 bands, the number of examples used\nfor training should be less than 200,000.\n\n#### Inference Limits\n\n\nSince Earth Engine processes 256x256 image tiles, inference requests on\nimagery must have fewer than 400 bands (again, assuming 32-bit precision of\nthe imagery).\n\n\nYou can retrain a classifier more than once to keep the dataset for each\ntraining run within limits. \n\n```javascript\n var trainings = ee.List.sequence(0, 3).map(function(cover) {\n return image.addBands(landcover.eq(cover).stratifiedSample(...)\n })\n\n var classifier = ee.Classifier.smileCart()\n .train(trainings.get(0), \"cover\")\n .train(trainings.get(1), \"cover\")\n .train(trainings.get(2), \"cover\")\n .train(trainings.get(3), \"cover\")\n \n```\n\n#### Limits on Model Size\n\n\nAdditionally, the model itself must be less than 100 MB. Many of our\nclassifiers can be configured to limit their complexity and hence, size.\nFor example: \n\n```javascript\n var classifier = ee.Classifier.smileRandomForest({\n numberOfTrees: 10,\n minLeafPopulation: 10,\n maxNodes: 10000\n })\n \n```"]]