/ Модель

Характеристики

Лицензия
Gemma
Библиотека
transformers
Опубликована
21 ноя 2024

paligemma2-3b-pt-896

Изображение и текст → текст6 профессий

Предварительно обученная мультимодальная модель Google для настройки на задачи анализа изображений и коротких видео с текстовыми запросами и ответами.

774скачиваний за 30 дней28лайковвеса обновлены5 дек 2024

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

PaliGemma 2 3B PT 896 — предварительно обученная мультимодальная модель Google на основе SigLIP и языковой модели Gemma 2. Она принимает изображения с разрешением 896×896 и текст, а генерирует текст; для дообучения доступны веса bfloat16. Модель рассчитана прежде всего на настройку под отдельные задачи компьютерного зрения и языка: описание изображений и коротких видео, визуальные вопросы и ответы, чтение текста на изображениях, обнаружение и сегментацию объектов. Также её можно адаптировать для вопросов по спутниковым снимкам и научным изображениям, помощи незрячим пользователям и описания функций элементов интерфейса.

Модель поддерживает несколько языков и обрабатывает текстовые последовательности длиной до 512 токенов на входе и выходе. Это базовая модель для дообучения, а не универсальный многотуровый чат-бот: качество без настройки на конкретную задачу может быть ниже, чем у специализированных моделей. Она может ошибаться в фактах и рассуждениях, испытывать трудности с неоднозначными запросами и отражать предубеждения обучающих данных. Использование регулируется условиями Gemma; разработчикам следует учитывать политику запрещённого использования Gemma.

Сценарии применения

  • создание подписей к изображениям
  • ответы на вопросы об изображении
  • распознавание текста на изображениях
  • обнаружение объектов на изображениях
  • сегментация объектов на изображениях
  • создание подписей к коротким видео

Ограничения

Это базовая модель, и её качество для конкретных задач может требовать дообучения; она не предназначена для многотурового диалога. Возможны фактические ошибки, слабое понимание сложных или неоднозначных запросов и предубеждения, унаследованные от обучающих данных.

Для каких профессий подходит6

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

PaliGemma 2 model card

Model page: PaliGemma

Transformers PaliGemma 2 3B weights, pre-trained with 896*896 input images and 512 token input/output text sequences. The model is available in the bfloat16 format for fine-tuning.

Resources and technical documentation:

Terms of Use: Terms

Authors: Google

Model information

Model summary

PaliGemma 2 is an update of the PaliGemma vision-language model (VLM) which incorporates the capabilities of the Gemma 2 models. The PaliGemma family of models is inspired by PaLI-3 and based on open components such as the SigLIP vision model and Gemma 2 language models. It takes both image and text as input and generates text as output, supporting multiple languages. It is designed for class-leading fine-tune performance on a wide range of vision-language tasks such as image and short video caption, visual question answering, text reading, object detection and object segmentation.

Model architecture

PaliGemma 2 is the composition of a Transformer decoder and a Vision Transformer image encoder. The text decoder is initialized from Gemma 2 in the 2B, 9B, and 27B parameter sizes. The image encoder is initialized from SigLIP-So400m/14. Similar to the original PaliGemma model, PaliGemma 2 is trained following the PaLI-3 recipes.

Inputs and outputs

  • Input: Image and text string, such as a prompt to caption the image, or a question.
  • Output: Generated text in response to the input, such as a caption of the image, an answer to a question, a list of object bounding box coordinates, or segmentation codewords.

Citation

@article{
    title={PaliGemma 2: A Family of Versatile VLMs for Transfer},
    author={Andreas Steiner and André Susano Pinto and Michael Tschannen and Daniel Keysers and Xiao Wang and Yonatan Bitton and Alexey Gritsenko and Matthias Minderer and Anthony Sherbondy and Shangbang Long and Siyang Qin and Reeve Ingle and Emanuele Bugliarello and Sahar Kazemzadeh and Thomas Mesnard and Ibrahim Alabdulmohsin and Lucas Beyer and Xiaohua Zhai},
    year={2024},
    journal={arXiv preprint arXiv:2412.03555}
}

Model data

Pre-train datasets

PaliGemma 2 is pre-trained on the following mixture of datasets:

PaliGemma 2 is based on Gemma 2, and you can find information on the pre-training datasets for Gemma 2 in the Gemma 2 model card.

Data responsibility filtering

The following filters are applied to WebLI, with the goal of training PaliGemma 2 on safe and responsible data:

  • Pornographic image filtering: This filter removes images deemed to be of pornographic nature.
  • Text safety filtering: We identify and filter out images that are paired with unsafe text. Unsafe text is any text deemed to contain or be about child sexual abuse imagery (CSAI), pornography, vulgarities, or is otherwise offensive.
  • Text toxicity filtering: We further use the Perspective API to identify and filter out images that are paired with text deemed insulting, obscene, hateful or otherwise toxic.
  • Text personal information filtering: We filtered certain personal information and other sensitive data using the Cloud Data Loss Prevention (DLP) API to protect the privacy of individuals. Identifiers such as social security numbers and other sensitive information types were removed.
  • Additional methods: Filtering based on content quality and safety in line with our policies and practices.

Use in Transformers

The following snippet uses model google/paligemma2-3b-pt-896 for reference purposes. It is a base model and is recommended to use after fine tuning it on a downstream task.

Here is a notebook that showcases fine-tuning PaliGemma 2.

from transformers import (
    PaliGemmaProcessor,
    PaliGemmaForConditionalGeneration,
)
from transformers.image_utils import load_image
import torch

model_id = "google/paligemma2-3b-pt-896"

url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg"
image = load_image(url)

model = PaliGemmaForConditionalGeneration.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto").eval()
processor = PaliGemmaProcessor.from_pretrained(model_id)

# Leaving the prompt blank for pre-trained models
prompt = ""
model_inputs = processor(text=prompt, images=image, return_tensors="pt").to(torch.bfloat16).to(model.device)
input_len = model_inputs["input_ids"].shape[-1]

with torch.inference_mode():
    generation = model.generate(**model_inputs, max_new_tokens=100, do_sample=False)
    generation = generation[0][input_len:]
    decoded = processor.decode(generation, skip_special_tokens=True)
    print(decoded)

Implementation information

Hardware

PaliGemma 2 was trained using the latest generation of Tensor Processing Unit (TPU) hardware (TPUv5e).

Software

Training was completed using JAX, Flax, TFDS and big_vision.

JAX allows researchers to take advantage of the latest generation of hardware, including TPUs, for faster and more efficient training of large models.

TFDS is used to access datasets and Flax is used for model architecture. The PaliGemma 2 fine-tune code and inference code are released in the big_vision GitHub repository.

Evaluation information

Benchmark results

In order to verify the transferability of PaliGemma 2 to a wide variety of academic tasks, we fine-tune the pretrained models on each task. We report results on different resolutions to provide an impression of which tasks benefit from increased resolution. Importantly, none of these tasks or datasets are part of the pretraining data mixture, and their images are explicitly removed from the web-scale pre-training data.

PaliGemma 2 results by model resolution and size

Benchmark224-3B224-10B224-28B448-3B448-10B448-28B
AI2D74.783.183.276.084.484.6
AOKVQA-DA (val)64.268.970.267.970.871.2
AOKVQA-MC (val)79.783.784.782.585.987.0
ActivityNet-CAP34.235.9----
ActivityNet-QA51.353.2----
COCO-35L (avg34)113.9115.8116.5115.8117.2117.2
COCO-35L (en)138.4140.8142.4140.4142.4142.3
COCOcap141.3143.7144.0143.4145.0145.2
ChartQA (aug)74.474.268.989.290.185.1
ChartQA (human)42.048.446.854.066.461.3
CountBenchQA81.084.086.482.085.387.4
DocVQA (val)39.943.944.973.676.676.1
GQA66.267.267.368.168.368.3
InfoVQA (val)25.233.636.437.547.846.7
MARVL (avg5)83.589.590.682.789.189.7
MSRVTT-CAP68.572.1----
MSRVTT-QA50.551.9----
MSVD-QA61.162.5----
NLVR291.493.994.291.693.794.1
NoCaps123.1126.3127.1123.5126.9127.0
OCR-VQA73.474.775.375.776.376.6
OKVQA64.268.071.264.168.670.6
RSVQA-hr (test)92.792.692.792.892.892.8
RSVQA-hr (test2)90.990.890.990.790.790.8
RSVQA-lr93.092.893.592.793.193.7
RefCOCO (testA)75.777.276.878.679.779.3
RefCOCO (testB)71.074.273.973.576.274.8
RefCOCO (val)73.475.975.076.378.277.3
RefCOCO+ (testA)72.774.773.676.177.776.6
RefCOCO+ (testB)64.268.467.167.071.168.6
RefCOCO+ (val)68.672.070.372.174.472.8
RefCOCOg (test)69.071.970.772.774.873.7
RefCOCOg (val)68.371.470.572.374.473.0
ST-VQA (val)61.964.365.180.582.081.8
SciCap165.1159.5156.9183.3177.2172.7
ScienceQA96.198.298.296.298.598.6
Screen2Words113.3117.8122.8114.0119.1123.4
TallyQA (complex)70.373.474.273.676.776.8
TallyQA (simple)81.883.283.485.386.285.7
TextCaps127.5137.9139.9152.1157.7153.6
TextVQA (val)59.664.064.775.276.676.2
VATEX80.882.7----
VQAv2 (minival)83.084.384.584.885.885.8
VizWizVQA (val)76.478.178.777.578.678.9
WidgetCap138.1139.8138.8151.4151.9148.9
XM3600 (avg35)42.844.545.243.244.645.2
XM3600 (en)79.880.781.080.381.581.0
xGQA (avg7)58.661.461.160.462.662.1

Additional Benchmarks

ICDAR 2015 Incidental

ModelPrecisionRecallF1
PaliGemma 2 3B81.8870.7375.9

Total-Text

ModelPrecisionRecallF1
PaliGemma 2 3B73.8.74.5474.17

FinTabNet

ModelS-TEDSTEDSGriTS-TopGriTS-Con
PaliGemma 2 3B99.1898.9499.4399.21

PubTabNet

ModelS-TEDSTEDSGriTS-TopGriTS-Con
PaliGemma 2 3B97.697.3197.9997.84

GrandStaff

ModelCERLERSER
PaliGemma 2 3B1.66.72.3

PubChem

  • PaliGemma 2 3B, Full Match: 94.8

DOCCI

Modelavg#charavg#sentNES %
PaliGemma 2 3B5297.7428.42
PaliGemma 2 10B5217.4520.27
  • avg#char: Average number of characters
  • avg#sent: Average number of sentences
  • NES: Non entailment sentences

MIMIC-CXR

ModelCIDErBLEU4Rouge-LRadGraph F1
PaliGemma 2 3B19.9%14.6%31.92%28.8%
PaliGemma 2 10B17.4%15%32.41%29.5%

Visual Spatial Reasoning

ModelVSR zeroshot split (test)VSR random split (test)
PaliGemma 2 3B0.750.82
PaliGemma 2 10B0.800.87

Ethics and safety

Evaluation approach

Our evaluation methods include structured ethics and safety evaluations across relevant content policies, including:

  • Human evaluation on prompts covering child safety, content safety and representational harms. See the Gemma model card for more details on evaluation approach, but with image captioning and visual question answering setups.
  • Image-to-Text benchmark evaluation: Benchmark against relevant academic datasets such as FairFace Dataset (Karkkainen et al., 2021).

Evaluation results

  • The human evaluation results of ethics and safety evaluations are within acceptable thresholds for meeting internal policies for categories such as child safety, content safety and representational harms.
  • On top of robust internal evaluations, we also use the Perspective API (threshold of 0.8) to measure toxicity, profanity, and other potential issues in the generated captions for images sourced from the FairFace dataset. We report the maximum and median values observed across subgroups for each of the perceived gender, ethnicity, and age attributes.

Usage and limitations

Intended usage

Open Vision Language Models (VLMs) have a wide range of applications across various industries and domains. The following list of potential uses is not comprehensive. The purpose of this list is to provide contextual information about the possible use-cases that the model creators considered as part of model training and development. Prohibited uses of Gemma models are outlined in the Gemma Prohibited Use Policy.

Fine-tune on specific vision-language task:

  • The pre-trained models can be fine-tuned on a wide range of vision-language tasks such as: image captioning, short video caption, visual question answering, text reading, object detection and object segmentation.
  • The pre-trained models can be fine-tuned for specific domains such as remote sensing question answering, visual questions from people who are blind, science question answering, describe UI element functionalities.
  • The pre-trained models can be fine-tuned for tasks with non-textual outputs such as bounding boxes or segmentation masks.

Vision-language research:

  • The pre-trained models and fine-tuned models can serve as a foundation for researchers to experiment with VLM techniques, develop algorithms, and contribute to the advancement of the field.

Ethical considerations and risks

The development of vision-language models (VLMs) raises several ethical concerns. In creating an open model, we have carefully considered the following:

  • Bias and Fairness
    • VLMs trained on large-scale, real-world image-text data can reflect socio-cultural biases embedded in the training material. These models underwent careful scrutiny, input data pre-processing described and posterior evaluations reported in this card.
  • Misinformation and Misuse
    • VLMs can be misused to generate text that is false, misleading, or harmful.
    • Guidelines are provided for responsible use with the model, see the Responsible Generative AI Toolkit.
  • Transparency and Accountability
    • This model card summarizes details on the models' architecture, capabilities, limitations, and evaluation processes.
    • A responsibly developed open model offers the opportunity to share innovation by making VLM technology accessible to developers and researchers across the AI ecosystem.

Risks identified and mitigations:

  • Perpetuation of biases: It's encouraged to perform continuous monitoring (using evaluation metrics, human review) and the exploration of de-biasing techniques during model training, fine-tuning, and other use cases.
  • Generation of harmful content: Mechanisms and guidelines for content safety are essential. Developers are encouraged to exercise caution and implement appropriate content safety safeguards based on their specific product policies and application use cases.
  • Misuse for malicious purposes: Technical limitations and developer and end-user education can help mitigate against malicious applications of LLMs. Educational resources and reporting mechanisms for users to flag misuse are provided: see the Responsible Generative AI Toolkit. Prohibited uses of Gemma models are outlined in the Gemma Prohibited Use Policy.
  • Privacy violations: Models were trained on data filtered to remove certain personal information and sensitive data. Developers are encouraged to adhere to privacy regulations with privacy-preserving techniques.

Limitations

  • Most limitations inherited from the underlying Gemma 2 models still apply:
    • VLMs are better at tasks that can be framed with clear prompts and instructions. Open-ended or highly complex tasks might be challenging.
    • Natural language is inherently complex. VLMs might struggle to grasp subtle nuances, sarcasm, or figurative language.
    • VLMs generate responses based on information they learned from their training datasets, but they are not knowledge bases. They may generate incorrect or outdated factual statements.
    • VLMs rely on statistical patterns in language and images. They might lack the ability to apply common sense reasoning in certain situations.
  • PaliGemma 2 was designed first and foremost to serve as a general pre-trained model for fine-tuning to specialized tasks. Hence, its "out of the box" or "zero-shot" performance might lag behind models designed specifically for general purpose use.
  • PaliGemma 2 is not a multi-turn chatbot. It is designed for a single round of image and text input.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Нельзя запустить

Доступ к модели ограничен автором; у платформы нет доступа к весам.

Ревизия весов
5a5194a

0 моделей