Google Earth Engine(GEE)——TensorFlow支持深度学习等高级机器学习方法(非免费项目)

简介: Google Earth Engine(GEE)——TensorFlow支持深度学习等高级机器学习方法(非免费项目)

TensorFlow 和地球引擎

TensorFlow是一个开源机器学习平台,支持深度学习等高级机器学习方法。本页面介绍了 Earth Engine 中的 TensorFlow 特定功能。尽管 TensorFlow 模型是在 Earth Engine 之外开发和训练的,但 Earth Engine API 提供了以 TFRecord 格式导出训练和测试数据以及以 TFRecord 格式导入/导出图像的方法。有关如何开发管道以将 TensorFlow 与 Earth Engine 中的数据结合使用的更多信息,请参阅 TensorFlow 示例页面。请参阅 TFRecord 页面以了解有关 Earth Engine 如何将数据写入 TFRecord 文件的更多信息。


ee.Model

ee.Model包处理与 TensorFlow 支持的机器学习模型的交互。


与 AI Platform 上托管的模型交互

ee.Model.fromAiPlatformPredictor(projectName, projectId, modelName, version, region, inputProperties, inputTypeOverride, inputShapes, proj, fixInputProj, inputTileSize, inputOverlapSize, outputTileSize, outputBands, outputProperties, outputMultiplier)

Returns an ee.Model from a description of an AI Platform prediction model. (See https://cloud.google.com/ml-engine/).


Arguments:

projectName (Object, default: null):

The Google Cloud project that owns the model. Deprecated: use "projectId" instead.

projectId (String, default: null):

The ID of the Google Cloud project that owns the model.

modelName (String, default: null):

The name of the model.

version (String, default: null):

The model version. Defaults to the AI Platform default model version.

region (String, default: null):

The model deployment region. Defaults to "us-central1".

inputProperties (List, default: null):

Properties passed with each prediction instance. Image predictions are tiled, so these properties will be replicated into each image tile instance. Defaults to no properties.

inputTypeOverride (Dictionary, default: null):

Types to which model inputs will be coerced if specified. Both Image bands and Image/Feature properties are valid.

inputShapes (Dictionary, default: null):

The fixed shape of input array bands. For each array band not specified, the fixed array shape will be automatically deduced from a non-masked pixel.

proj (Projection, default: null):

The input projection at which to sample all bands. Defaults to the default projection of an image's first band.

fixInputProj (Boolean, default: null):

If true, pixels will be sampled in a fixed projection specified by 'proj'. The output projection is used otherwise. Defaults to false.

inputTileSize (List, default: null):

Rectangular dimensions of pixel tiles passed in to prediction instances. Required for image predictions.

inputOverlapSize (List, default: null):

Amount of adjacent-tile overlap in X/Y along each edge of pixel tiles passed in to prediction instances. Defaults to [0, 0].

outputTileSize (List, default: null):

Rectangular dimensions of pixel tiles returned from AI Platform. Defaults to the value in 'inputTileSize'.

outputBands (Dictionary, default: null):

A map from output band names to a dictionary of output band info. Valid band info fields are 'type' and 'dimensions'. 'type' should be a ee.PixelType describing the output band, and 'dimensions' is an optional integer with the number of dimensions in that band e.g.: "outputBands: {'p': {'type': ee.PixelType.int8(), 'dimensions': 1}}". Required for image predictions.

outputProperties (Dictionary, default: null):

A map from output property names to a dictionary of output property info. Valid property info fields are 'type' and 'dimensions'. 'type' should be a ee.PixelType describing the output property, and 'dimensions' is an optional integer with the number of dimensions for that property if it is an array e.g.: "outputBands: {'p': {'type': ee.PixelType.int8(), 'dimensions': 1}}". Required for predictions from FeatureCollections.

outputMultiplier (Float, default: null):

An approximation to the increase in data volume for the model outputs over the model inputs. If specified this must be >= 1. This is only needed if the model produces more data than it consumes, e.g. a model that takes 5 bands and produces 10 outputs per pixel.


Returns: Model

ee.Model可以创建 一个新实例 ee.Model.fromAiPlatformPredictor()。这是一个ee.Model将 Earth Engine 数据打包成张量的对象,将它们作为预测请求转发到 Google AI Platform,然后自动将响应重新组合为 Earth Engine 数据类型。请注意,根据模型及其输入的大小和复杂性,您可能希望 调整AI Platform 模型的最小节点大小以适应大量预测。

Earth Engine 要求 AI Platform 模型使用 TensorFlow 的 SavedModel 格式。在托管模型可以与地球引擎交互之前,其输入/输出需要与 TensorProto 交换格式兼容,特别是在 base64 中序列化的 TensorProtos。为model prepare简化此操作,Earth Engine CLI 具有 将现有 SavedModel 包装在所需操作中以转换输入/输出格式的命令。

要将模型与 一起使用ee.Model.fromAiPlatformPredictor(),您必须具有足够的权限才能使用该模型。具体来说,您(或使用该模型的任何人)至少需要 ML Engine Model User 角色。您可以从Cloud Console模型页面检查和设置模型权限 。


地区

您应该为模型使用区域端点,在模型创建、版本创建和ee.Model.fromAiPlatformPredictor(). 任何区域都可以工作(不要使用全局),但us-central1首选。不要指定 REGIONS参数。如果您是从Cloud Console创建模型 ,请确保选中区域框。


费用

警告!这些指南使用 Google Cloud 的计费组件,包括:

您可以使用 定价计算器根据您的预计使用情况生成成本估算。


图像预测

predictImage(image)

Make predictions from pixel tiles of an image. The predictions are merged as bands with the input image.

The model will receive 0s in place of masked pixels. The masks of predicted output bands are the minimum of the masks of the inputs.


Arguments:

this:model (Model)

image (Image):

The input image.


Returns: Image

用于model.predictImage()ee.Image 使用托管模型进行预测。的返回类型predictImage()是 an ee.Image,可以添加到地图、用于其他计算、导出等。Earth Engine 将自动平铺输入波段并根据需要调整输出投影以进行比例更改和覆盖。(有关平铺工作原理的更多信息,请参阅 TFRecord 文档)。请注意,即使带是标量(最后一个维度将为 1),地球引擎也会始终将 3D 张量转发到您的模型。

几乎所有的卷积模型都有一个固定的输入投影(模型训练的数据的投影)。在这种情况下,请在调用 时将fixInputProj参数设置为trueee.Model.fromAiPlatformPredictor()。在可视化预测时,在缩小具有固定输入投影的模型时要小心。这与此处描述的原因相同。具体而言,缩放到较大的空间范围可能会导致请求过多数据,并可能表现为 AI Platform 速度减慢或拒绝。


相关文章
|
1月前
|
数据可视化 定位技术 Sentinel
如何用Google Earth Engine快速、大量下载遥感影像数据?
【2月更文挑战第9天】本文介绍在谷歌地球引擎(Google Earth Engine,GEE)中,批量下载指定时间范围、空间范围的遥感影像数据(包括Landsat、Sentinel等)的方法~
1101 1
如何用Google Earth Engine快速、大量下载遥感影像数据?
|
4天前
|
机器学习/深度学习 并行计算 算法
深度学习中的自动化超参数优化方法探究
传统的深度学习模型优化通常依赖于人工调整超参数,这一过程繁琐且耗时。本文探讨了当前流行的自动化超参数优化方法,包括贝叶斯优化、遗传算法和进化策略等,分析它们在提高模型效率和性能方面的应用与挑战。
|
11天前
|
机器学习/深度学习 算法 数据可视化
【从零开始学习深度学习】46. 目标检测中锚框的概念、计算方法、样本锚框标注方式及如何选取预测边界框
【从零开始学习深度学习】46. 目标检测中锚框的概念、计算方法、样本锚框标注方式及如何选取预测边界框
|
12天前
|
机器学习/深度学习 PyTorch 算法框架/工具
【从零开始学习深度学习】18. Pytorch中自定义层的几种方法:nn.Module、ParameterList和ParameterDict
【从零开始学习深度学习】18. Pytorch中自定义层的几种方法:nn.Module、ParameterList和ParameterDict
|
11天前
|
机器学习/深度学习 算法 PyTorch
【从零开始学习深度学习】45. Pytorch迁移学习微调方法实战:使用微调技术进行2分类图片热狗识别模型训练【含源码与数据集】
【从零开始学习深度学习】45. Pytorch迁移学习微调方法实战:使用微调技术进行2分类图片热狗识别模型训练【含源码与数据集】
|
12天前
|
机器学习/深度学习 PyTorch 算法框架/工具
【从零开始学习深度学习】17. Pytorch中模型参数的访问、初始化和共享方法
【从零开始学习深度学习】17. Pytorch中模型参数的访问、初始化和共享方法
|
1月前
|
机器学习/深度学习 自然语言处理 算法
深度解析深度学习中的优化算法:从梯度下降到自适应方法
【4月更文挑战第28天】 在深度学习模型训练的复杂数学迷宫中,优化算法是寻找最优权重配置的关键导航者。本文将深入探讨几种主流的优化策略,揭示它们如何引导模型收敛至损失函数的最小值。我们将比较经典的批量梯度下降(BGD)、随机梯度下降(SGD)以及动量概念的引入,进一步探索AdaGrad、RMSProp和Adam等自适应学习率方法的原理与实际应用。通过剖析这些算法的理论基础和性能表现,我们旨在为读者提供一个关于选择合适优化器的参考视角。
|
1月前
|
机器学习/深度学习 存储 自然语言处理
深度探索自适应学习率调整:从传统方法到深度学习优化器
【5月更文挑战第15天】 在深度学习的复杂网络结构与海量数据中,学习率作为模型训练的关键超参数,其调整策略直接影响着模型的收敛速度与最终性能。传统的学习率调整方法,如固定学习率、学习率衰减等,虽然简单易行,但在多样化的任务面前往往显得力不从心。近年来,随着自适应学习率技术的兴起,一系列创新的优化器如Adam、RMSProp和Adagrad等应运而生,它们通过引入自适应机制动态调整学习率,显著改善了模型的训练效率与泛化能力。本文将深入剖析传统学习率调整方法的原理与局限性,并详细介绍当前主流的自适应学习率优化器,最后探讨未来可能的发展方向。
|
1月前
|
存储 编解码 数据可视化
Google Earth Engine获取随机抽样点并均匀分布在栅格的不同数值区中
【2月更文挑战第14天】本文介绍在谷歌地球引擎(Google Earth Engine,GEE)中,按照给定的地表分类数据,对每一种不同的地物类型,分别加以全球范围内随机抽样点自动批量选取的方法~
309 1
Google Earth Engine获取随机抽样点并均匀分布在栅格的不同数值区中
|
1月前
|
人工智能 自然语言处理 负载均衡
这款 AI 网关项目简直太棒了,轻松接入OpenAI、LLama2、Google Gem)ini等 100 多种大语言模型!
这款 AI 网关项目简直太棒了,轻松接入OpenAI、LLama2、Google Gem)ini等 100 多种大语言模型!

热门文章

最新文章