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 速度减慢或拒绝。


相关文章
|
机器学习/深度学习 人工智能 安全
探索AI的未来:从机器学习到深度学习
【10月更文挑战第28天】本文将带你走进AI的世界,从机器学习的基本概念到深度学习的复杂应用,我们将一起探索AI的未来。你将了解到AI如何改变我们的生活,以及它在未来可能带来的影响。无论你是AI专家还是初学者,这篇文章都将为你提供新的视角和思考。让我们一起探索AI的奥秘,看看它将如何塑造我们的未来。
598 3
|
机器学习/深度学习 人工智能 供应链
从概念到商业价值:AI、机器学习与深度学习全景指南
在这个科技飞速发展的时代🚀,人工智能正以惊人的速度渗透到我们的生活和工作中👀。但面对铺天盖地的AI术语和概念,很多人感到困惑不已😣。"AI"、"机器学习"、"深度学习"和"神经网络"到底有什么区别?它们如何相互关联?如何利用这些技术提升工作效率和创造价值?
780 0
|
机器学习/深度学习 并行计算 PyTorch
【机器学习】探索GRU:深度学习中门控循环单元的魅力
【机器学习】探索GRU:深度学习中门控循环单元的魅力
2448 0
|
机器学习/深度学习 人工智能 JSON
知识蒸馏方法探究:Google Distilling Step-by-Step 论文深度分析
大型语言模型(LLM)的发展迅速,从简单对话系统进化到能执行复杂任务的先进模型。然而,这些模型的规模和计算需求呈指数级增长,给学术界和工业界带来了挑战。为解决这一问题,知识蒸馏技术应运而生,旨在将大型模型的知识转移给更小、更易管理的学生模型。Google Research 提出的“Distilling Step-by-Step”方法不仅减小了模型规模,还通过提取推理过程使学生模型在某些任务上超越教师模型。该方法通过多任务学习框架,训练学生模型同时预测标签和生成推理过程,从而实现更高效、更智能的小型化模型。这为资源有限的研究者和开发者提供了新的解决方案,推动了AI技术的普及与应用。
1018 19
知识蒸馏方法探究:Google Distilling Step-by-Step 论文深度分析
|
机器学习/深度学习 人工智能 算法
探索机器学习:从线性回归到深度学习
本文将带领读者从基础的线性回归模型开始,逐步深入到复杂的深度学习网络。我们将通过代码示例,展示如何实现这些算法,并解释其背后的数学原理。无论你是初学者还是有经验的开发者,这篇文章都将为你提供有价值的见解和知识。让我们一起踏上这段激动人心的旅程吧!
392 3
|
机器学习/深度学习 人工智能 TensorFlow
基于TensorFlow的深度学习模型训练与优化实战
基于TensorFlow的深度学习模型训练与优化实战
888 3
|
机器学习/深度学习 TensorFlow API
机器学习实战:TensorFlow在图像识别中的应用探索
【10月更文挑战第28天】随着深度学习技术的发展,图像识别取得了显著进步。TensorFlow作为Google开源的机器学习框架,凭借其强大的功能和灵活的API,在图像识别任务中广泛应用。本文通过实战案例,探讨TensorFlow在图像识别中的优势与挑战,展示如何使用TensorFlow构建和训练卷积神经网络(CNN),并评估模型的性能。尽管面临学习曲线和资源消耗等挑战,TensorFlow仍展现出广阔的应用前景。
590 5
|
机器学习/深度学习 人工智能 算法
【手写数字识别】Python+深度学习+机器学习+人工智能+TensorFlow+算法模型
手写数字识别系统,使用Python作为主要开发语言,基于深度学习TensorFlow框架,搭建卷积神经网络算法。并通过对数据集进行训练,最后得到一个识别精度较高的模型。并基于Flask框架,开发网页端操作平台,实现用户上传一张图片识别其名称。
1154 0
【手写数字识别】Python+深度学习+机器学习+人工智能+TensorFlow+算法模型
|
机器学习/深度学习 算法 决策智能
【机器学习】揭秘深度学习优化算法:加速训练与提升性能
【机器学习】揭秘深度学习优化算法:加速训练与提升性能
|
机器学习/深度学习 人工智能 算法
揭开深度学习与传统机器学习的神秘面纱:从理论差异到实战代码详解两者间的选择与应用策略全面解析
【10月更文挑战第10天】本文探讨了深度学习与传统机器学习的区别,通过图像识别和语音处理等领域的应用案例,展示了深度学习在自动特征学习和处理大规模数据方面的优势。文中还提供了一个Python代码示例,使用TensorFlow构建多层感知器(MLP)并与Scikit-learn中的逻辑回归模型进行对比,进一步说明了两者的不同特点。
1000 2

热门文章

最新文章

推荐镜像

更多