Image-Text-to-Text
sam2
English
agriculture
multimodal
vision-language
visual-grounding
image-segmentation
grounded-caption-generation
referring-expression-segmentation
bioclip
dinov3
Instructions to use boudiafA/AgriScope with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sam2
How to use boudiafA/AgriScope with sam2:
# Use SAM2 with images import torch from sam2.sam2_image_predictor import SAM2ImagePredictor predictor = SAM2ImagePredictor.from_pretrained(boudiafA/AgriScope) with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16): predictor.set_image(<your_image>) masks, _, _ = predictor.predict(<input_prompts>)# Use SAM2 with videos import torch from sam2.sam2_video_predictor import SAM2VideoPredictor predictor = SAM2VideoPredictor.from_pretrained(boudiafA/AgriScope) with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16): state = predictor.init_state(<your_video>) # add new prompts and instantly get the output on the same frame frame_idx, object_ids, masks = predictor.add_new_points(state, <your_prompts>): # propagate the prompts to get masklets throughout the video for frame_idx, object_ids, masks in predictor.propagate_in_video(state): ... - Notebooks
- Google Colab
- Kaggle
Add AgriScope model card and project assets
Browse files- .gitattributes +7 -0
- .gitignore +20 -0
- CITATION.cff +20 -0
- LICENSE +201 -0
- README.md +274 -0
- docs/TASKS.md +65 -0
- images/annotation_pipeline.png +3 -0
- images/architecture.png +3 -0
- images/overview.png +3 -0
- images/qualitative_gcg.png +3 -0
- images/qualitative_tasks.png +3 -0
- images/referring_segmentation_comparison.png +3 -0
- images/task_examples_v3.png +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,10 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
images/annotation_pipeline.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
images/architecture.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
images/overview.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
images/qualitative_gcg.png filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
images/qualitative_tasks.png filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
images/referring_segmentation_comparison.png filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
images/task_examples_v3.png filter=lfs diff=lfs merge=lfs -text
|
.gitignore
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__pycache__/
|
| 2 |
+
*.py[cod]
|
| 3 |
+
*.so
|
| 4 |
+
|
| 5 |
+
.DS_Store
|
| 6 |
+
Thumbs.db
|
| 7 |
+
|
| 8 |
+
.venv/
|
| 9 |
+
venv/
|
| 10 |
+
env/
|
| 11 |
+
.env
|
| 12 |
+
|
| 13 |
+
checkpoints/
|
| 14 |
+
weights/
|
| 15 |
+
outputs/
|
| 16 |
+
results/
|
| 17 |
+
wandb/
|
| 18 |
+
|
| 19 |
+
*.log
|
| 20 |
+
*.tmp
|
CITATION.cff
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
cff-version: 1.2.0
|
| 2 |
+
message: "If you use AgriScope in your research, please cite the accompanying paper."
|
| 3 |
+
title: "AgriScope: Pixel-Grounded Multimodal Understanding for Agriculture Images"
|
| 4 |
+
type: software
|
| 5 |
+
authors:
|
| 6 |
+
- family-names: Boudiaf
|
| 7 |
+
given-names: Abderrahmene
|
| 8 |
+
- family-names: Alanssari
|
| 9 |
+
given-names: Mohamad
|
| 10 |
+
- family-names: Hussain
|
| 11 |
+
given-names: Irfan
|
| 12 |
+
- family-names: Javed
|
| 13 |
+
given-names: Sajid
|
| 14 |
+
repository-code: "https://github.com/boudiafA/AgriScope"
|
| 15 |
+
url: "https://github.com/boudiafA/AgriScope"
|
| 16 |
+
license: Apache-2.0
|
| 17 |
+
date-released: 2026-07-17
|
| 18 |
+
abstract: >-
|
| 19 |
+
AgriScope is a unified pixel-grounded multimodal framework for image-level,
|
| 20 |
+
region-level, and pixel-level understanding of agricultural imagery.
|
LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
| 177 |
+
|
| 178 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 179 |
+
|
| 180 |
+
To apply the Apache License to your work, attach the following
|
| 181 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 182 |
+
replaced with your own identifying information. (Don't include
|
| 183 |
+
the brackets.) The text should be enclosed in the appropriate
|
| 184 |
+
comment syntax for the file format. We also recommend that a
|
| 185 |
+
file or class name and description of purpose be included on the
|
| 186 |
+
same "printed page" as the copyright notice for easier
|
| 187 |
+
identification within third-party archives.
|
| 188 |
+
|
| 189 |
+
Copyright [yyyy] [name of copyright owner]
|
| 190 |
+
|
| 191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 192 |
+
you may not use this file except in compliance with the License.
|
| 193 |
+
You may obtain a copy of the License at
|
| 194 |
+
|
| 195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 196 |
+
|
| 197 |
+
Unless required by applicable law or agreed to in writing, software
|
| 198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 200 |
+
See the License for the specific language governing permissions and
|
| 201 |
+
limitations under the License.
|
README.md
CHANGED
|
@@ -1,3 +1,277 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
pipeline_tag: image-text-to-text
|
| 6 |
+
tags:
|
| 7 |
+
- agriculture
|
| 8 |
+
- multimodal
|
| 9 |
+
- vision-language
|
| 10 |
+
- visual-grounding
|
| 11 |
+
- image-segmentation
|
| 12 |
+
- grounded-caption-generation
|
| 13 |
+
- referring-expression-segmentation
|
| 14 |
+
- sam2
|
| 15 |
+
- bioclip
|
| 16 |
+
- dinov3
|
| 17 |
+
inference: false
|
| 18 |
---
|
| 19 |
+
|
| 20 |
+
# AgriScope
|
| 21 |
+
|
| 22 |
+
<p align="center">
|
| 23 |
+
<strong>Pixel-Grounded Multimodal Understanding for Agriculture Images</strong>
|
| 24 |
+
</p>
|
| 25 |
+
|
| 26 |
+
<p align="center">
|
| 27 |
+
<strong>Abderrahmene Boudiaf, Mohamad Alanssari, Irfan Hussain, Sajid Javed</strong><br>
|
| 28 |
+
Khalifa University of Science and Technology, Abu Dhabi, UAE
|
| 29 |
+
</p>
|
| 30 |
+
|
| 31 |
+
<p align="center">
|
| 32 |
+
<a href="https://github.com/boudiafA/AgriScope"><img src="https://img.shields.io/badge/GitHub-Repository-181717" alt="GitHub repository"></a>
|
| 33 |
+
<img src="https://img.shields.io/badge/Paper-Coming%20soon-lightgrey" alt="Paper coming soon">
|
| 34 |
+
<img src="https://img.shields.io/badge/Weights-Coming%20soon-lightgrey" alt="Weights coming soon">
|
| 35 |
+
<img src="https://img.shields.io/badge/Dataset-Coming%20soon-lightgrey" alt="Dataset coming soon">
|
| 36 |
+
</p>
|
| 37 |
+
|
| 38 |
+
> **Release status:** This repository currently provides the AgriScope model card, project figures, task definitions, and reported manuscript results. Model weights, configuration files, processors, training code, and AgriGround annotations are coming soon.
|
| 39 |
+
|
| 40 |
+
## Model Description
|
| 41 |
+
|
| 42 |
+
<p align="center">
|
| 43 |
+
<img src="images/overview.png" alt="AgriScope and AgriGround overview" width="100%">
|
| 44 |
+
</p>
|
| 45 |
+
|
| 46 |
+
**AgriScope** is a pixel-grounded multimodal model for agricultural image understanding. It supports image-level, region-level, and pixel-level interaction within one framework, connecting generated agricultural concepts to segmentation masks and spatial annotations.
|
| 47 |
+
|
| 48 |
+
The model is designed to identify, describe, localize, and segment agricultural entities including plant diseases, lesions, pests, crops, weeds, botanical species, plant organs, and structural features. It supports both text-only responses and responses grounded in masks or normalized bounding boxes.
|
| 49 |
+
|
| 50 |
+
AgriScope is trained with **AgriGround**, a large-scale pixel-grounded agricultural instruction-tuning dataset containing **503,919 images** and **11,421,148 samples** across **14 tasks**.
|
| 51 |
+
|
| 52 |
+
### Model Details
|
| 53 |
+
|
| 54 |
+
| Property | Description |
|
| 55 |
+
|---|---|
|
| 56 |
+
| Model type | Pixel-grounded multimodal language model |
|
| 57 |
+
| Domain | Agriculture and plant imagery |
|
| 58 |
+
| Languages | English |
|
| 59 |
+
| Parameter count | 2B total parameters, as reported in the manuscript |
|
| 60 |
+
| Visual representation | Biological semantic and dense spatial encoders |
|
| 61 |
+
| Grounding | Language-conditioned `[SEG]` states with a SAM2-driven decoder |
|
| 62 |
+
| Adaptation | Projection alignment followed by LoRA instruction tuning |
|
| 63 |
+
| License | Apache-2.0 for repository materials and future code release |
|
| 64 |
+
| Model weights | **Coming soon** |
|
| 65 |
+
|
| 66 |
+
## Architecture
|
| 67 |
+
|
| 68 |
+
<p align="center">
|
| 69 |
+
<img src="images/architecture.png" alt="AgriScope architecture" width="100%">
|
| 70 |
+
</p>
|
| 71 |
+
|
| 72 |
+
AgriScope combines complementary semantic and spatial pathways:
|
| 73 |
+
|
| 74 |
+
1. A biological contextual encoder extracts agricultural and biological semantics.
|
| 75 |
+
2. A global contextual encoder preserves texture, morphology, boundaries, and dense spatial information.
|
| 76 |
+
3. Projection layers map visual representations into the multimodal language space.
|
| 77 |
+
4. The language model generates text and special `[SEG]` tokens for grounded concepts.
|
| 78 |
+
5. Each `[SEG]` hidden state conditions the SAM2-driven mask decoder to produce a corresponding pixel-level mask.
|
| 79 |
+
|
| 80 |
+
The manuscript implementation initializes its visual and grounding components from BioCLIP, DINOv3, and SAM2. The large pretrained encoders remain frozen while alignment modules and LoRA parameters are optimized.
|
| 81 |
+
|
| 82 |
+
### Inputs
|
| 83 |
+
|
| 84 |
+
- An agricultural RGB image
|
| 85 |
+
- A natural-language instruction or question
|
| 86 |
+
- An optional region for region-conditioned tasks
|
| 87 |
+
- Optional conversation history for multi-turn interaction
|
| 88 |
+
|
| 89 |
+
### Outputs
|
| 90 |
+
|
| 91 |
+
- Natural-language captions and answers
|
| 92 |
+
- Interleaved grounded captions with phrase-mask correspondence
|
| 93 |
+
- Referring-expression, semantic, and part segmentation masks
|
| 94 |
+
- Region-conditioned descriptions and conversations
|
| 95 |
+
- Counts and normalized bounding boxes
|
| 96 |
+
- Multi-turn grounded responses
|
| 97 |
+
|
| 98 |
+
## Intended Uses
|
| 99 |
+
|
| 100 |
+
### Primary Research Uses
|
| 101 |
+
|
| 102 |
+
- Agricultural image captioning and visual question answering
|
| 103 |
+
- Plant disease, pest, weed, crop, and species understanding
|
| 104 |
+
- Referring expression and semantic segmentation
|
| 105 |
+
- Grounded caption generation
|
| 106 |
+
- Region-level and multi-turn grounded interaction
|
| 107 |
+
- Agricultural object counting, detection, and localization
|
| 108 |
+
- Research on interpretable and evidence-grounded agricultural AI
|
| 109 |
+
|
| 110 |
+
### Out-of-Scope Uses
|
| 111 |
+
|
| 112 |
+
- Autonomous pesticide, treatment, or crop-management decisions without expert review
|
| 113 |
+
- Safety-critical agricultural robotics without independent perception safeguards
|
| 114 |
+
- Regulatory, insurance, or legal determinations
|
| 115 |
+
- Identification of entities outside the supported visual and agricultural domains
|
| 116 |
+
|
| 117 |
+
## AgriGround Training Data
|
| 118 |
+
|
| 119 |
+
<p align="center">
|
| 120 |
+
<img src="images/annotation_pipeline.png" alt="AgriGround annotation pipeline" width="100%">
|
| 121 |
+
</p>
|
| 122 |
+
|
| 123 |
+
AgriGround is produced using a four-stage annotation and task-generation pipeline:
|
| 124 |
+
|
| 125 |
+
1. Generate detailed image captions, class descriptions, counts, and bounding-box metadata.
|
| 126 |
+
2. Correct captions, identify grounded object phrases, and prepare segmentation prompts.
|
| 127 |
+
3. Generate and align segmentation masks with grounded phrases.
|
| 128 |
+
4. Synthesize instruction-following records for the 14 supported tasks.
|
| 129 |
+
|
| 130 |
+
### Dataset Statistics
|
| 131 |
+
|
| 132 |
+
| Split | Images | Samples | Average samples/image |
|
| 133 |
+
|---|---:|---:|---:|
|
| 134 |
+
| Train | 401,234 | 9,095,320 | 22.66 |
|
| 135 |
+
| Test | 102,685 | 2,325,828 | 22.66 |
|
| 136 |
+
| **Total** | **503,919** | **11,421,148** | **22.66** |
|
| 137 |
+
|
| 138 |
+
| Source group | Images | Share |
|
| 139 |
+
|---|---:|---:|
|
| 140 |
+
| Classification datasets | 232,923 | 46.22% |
|
| 141 |
+
| Detection datasets | 27,938 | 5.54% |
|
| 142 |
+
| iNatAg subset | 169,324 | 33.60% |
|
| 143 |
+
| Insects (IP102) | 73,734 | 14.63% |
|
| 144 |
+
|
| 145 |
+
### Supported Tasks
|
| 146 |
+
|
| 147 |
+
| Family | Tasks |
|
| 148 |
+
|---|---|
|
| 149 |
+
| Captioning | Image-level captioning, region-level captioning, grounded caption generation |
|
| 150 |
+
| Segmentation | Referring expression segmentation, semantic segmentation, part segmentation |
|
| 151 |
+
| Detection and localization | Phrase grounding, grounded counting, grounded detection, reasoning detection |
|
| 152 |
+
| Conversation and QA | Region-level conversation, multi-turn grounded conversation, classification QA, negative absence QA |
|
| 153 |
+
|
| 154 |
+
<p align="center">
|
| 155 |
+
<img src="images/task_examples_v3.png" alt="Task-specific AgriGround examples" width="62%">
|
| 156 |
+
</p>
|
| 157 |
+
|
| 158 |
+
See [docs/TASKS.md](docs/TASKS.md) for definitions and per-task sample counts.
|
| 159 |
+
|
| 160 |
+
The source agricultural images are not distributed in this repository. Their original licenses and terms remain applicable. Annotation download instructions and dataset-specific licensing details will accompany the public dataset release.
|
| 161 |
+
|
| 162 |
+
## Training Procedure
|
| 163 |
+
|
| 164 |
+
Training follows two stages described in the manuscript:
|
| 165 |
+
|
| 166 |
+
1. **Visual-language and grounding alignment:** optimize projection layers, grounding modules, and the segmentation decoder while keeping the pretrained backbones frozen.
|
| 167 |
+
2. **Instruction tuning:** apply parameter-efficient LoRA adaptation using the 14 AgriGround tasks while retaining frozen visual encoders.
|
| 168 |
+
|
| 169 |
+
The joint objective combines autoregressive language modeling with binary cross-entropy and Dice losses for segmentation supervision. Full hyperparameters, preprocessing, and reproducibility scripts will be released with the code.
|
| 170 |
+
|
| 171 |
+
## Evaluation
|
| 172 |
+
|
| 173 |
+
The following results are reported in the current manuscript draft.
|
| 174 |
+
|
| 175 |
+
| Task | Metrics | AgriScope |
|
| 176 |
+
|---|---|---:|
|
| 177 |
+
| Image-level captioning | CIDEr / ASF | **146.4 / 86.7** |
|
| 178 |
+
| Region-level captioning | CIDEr / ASF | **132.5 / 84.8** |
|
| 179 |
+
| Classification QA | Accuracy / F1 | **82.4 / 80.7** |
|
| 180 |
+
| Grounded counting | Accuracy | **74.8** |
|
| 181 |
+
| Semantic segmentation | mIoU / Dice | **66.1 / 78.4** |
|
| 182 |
+
| Referring expression segmentation | J&F / cIoU | **67.30 / 72.65** |
|
| 183 |
+
| Grounded caption generation | METEOR / CIDEr | **27.9 / 118.6** |
|
| 184 |
+
| Grounded caption generation | AP50 / mIoU / Recall | **63.9 / 59.4 / 74.2** |
|
| 185 |
+
|
| 186 |
+
### Efficiency
|
| 187 |
+
|
| 188 |
+
| Parameters | GFLOPs | GPU memory | Inference time |
|
| 189 |
+
|---:|---:|---:|---:|
|
| 190 |
+
| **2B** | **177** | **6 GB** | **480 ms/image** |
|
| 191 |
+
|
| 192 |
+
Complete baseline comparisons, cross-dataset evaluation, ablations, and experimental settings will accompany the paper release.
|
| 193 |
+
|
| 194 |
+
## Qualitative Results
|
| 195 |
+
|
| 196 |
+
### Grounded Caption Generation
|
| 197 |
+
|
| 198 |
+
<p align="center">
|
| 199 |
+
<img src="images/qualitative_gcg.png" alt="AgriScope grounded caption generation examples" width="100%">
|
| 200 |
+
</p>
|
| 201 |
+
|
| 202 |
+
### Representative Tasks
|
| 203 |
+
|
| 204 |
+
<p align="center">
|
| 205 |
+
<img src="images/qualitative_tasks.png" alt="AgriScope representative task results" width="100%">
|
| 206 |
+
</p>
|
| 207 |
+
|
| 208 |
+
### Referring Expression Segmentation
|
| 209 |
+
|
| 210 |
+
<p align="center">
|
| 211 |
+
<img src="images/referring_segmentation_comparison.png" alt="Referring expression segmentation comparison" width="100%">
|
| 212 |
+
</p>
|
| 213 |
+
|
| 214 |
+
## Limitations and Risks
|
| 215 |
+
|
| 216 |
+
- AgriScope can produce plausible but incorrect descriptions, classifications, counts, or masks.
|
| 217 |
+
- Performance may degrade under poor illumination, blur, occlusion, unusual viewpoints, severe domain shift, or very small targets.
|
| 218 |
+
- Fine-grained diseases, species, and pests with similar visual characteristics may be confused.
|
| 219 |
+
- Segmentation quality depends on the visual coverage and annotation quality of the training data.
|
| 220 |
+
- Dataset composition may encode geographic, crop, acquisition, and class-frequency biases from its source datasets.
|
| 221 |
+
- Outputs require review by qualified agricultural experts before being used for diagnosis or management decisions.
|
| 222 |
+
|
| 223 |
+
## Repository Contents
|
| 224 |
+
|
| 225 |
+
```text
|
| 226 |
+
.
|
| 227 |
+
|-- README.md
|
| 228 |
+
|-- CITATION.cff
|
| 229 |
+
|-- LICENSE
|
| 230 |
+
|-- docs/
|
| 231 |
+
| `-- TASKS.md
|
| 232 |
+
`-- images/
|
| 233 |
+
|-- overview.png
|
| 234 |
+
|-- architecture.png
|
| 235 |
+
|-- annotation_pipeline.png
|
| 236 |
+
|-- task_examples_v3.png
|
| 237 |
+
|-- qualitative_gcg.png
|
| 238 |
+
|-- qualitative_tasks.png
|
| 239 |
+
`-- referring_segmentation_comparison.png
|
| 240 |
+
```
|
| 241 |
+
|
| 242 |
+
## Release Roadmap
|
| 243 |
+
|
| 244 |
+
| Resource | Status |
|
| 245 |
+
|---|---|
|
| 246 |
+
| Model weights and configuration | **Coming soon** |
|
| 247 |
+
| Processor and inference example | **Coming soon** |
|
| 248 |
+
| Training and evaluation code | **Coming soon** |
|
| 249 |
+
| AgriGround train/test annotations | **Coming soon** |
|
| 250 |
+
| Paper and final citation | **Coming soon** |
|
| 251 |
+
|
| 252 |
+
Development updates and future code releases are tracked in the [AgriScope GitHub repository](https://github.com/boudiafA/AgriScope).
|
| 253 |
+
|
| 254 |
+
## Citation
|
| 255 |
+
|
| 256 |
+
The final paper link and citation will be added upon release. Until then, please use:
|
| 257 |
+
|
| 258 |
+
```bibtex
|
| 259 |
+
@misc{boudiaf2026agriscope,
|
| 260 |
+
title = {AgriScope: Pixel-Grounded Multimodal Understanding for Agriculture Images},
|
| 261 |
+
author = {Boudiaf, Abderrahmene and Alanssari, Mohamad and Hussain, Irfan and Javed, Sajid},
|
| 262 |
+
year = {2026},
|
| 263 |
+
note = {Manuscript under review}
|
| 264 |
+
}
|
| 265 |
+
```
|
| 266 |
+
|
| 267 |
+
## License
|
| 268 |
+
|
| 269 |
+
Repository documentation and the future code release are provided under the [Apache License 2.0](LICENSE). AgriGround annotations and source images may be subject to separate terms, which will be documented with the dataset release.
|
| 270 |
+
|
| 271 |
+
## Acknowledgments
|
| 272 |
+
|
| 273 |
+
This work was conducted at Khalifa University of Science and Technology, Abu Dhabi, UAE. We acknowledge the creators and maintainers of the agricultural datasets and open-source foundation models that support this research.
|
| 274 |
+
|
| 275 |
+
## Contact
|
| 276 |
+
|
| 277 |
+
For questions and collaborations, use the [AgriScope GitHub issue tracker](https://github.com/boudiafA/AgriScope/issues) or the Hugging Face Community tab.
|
docs/TASKS.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AgriGround Task Reference
|
| 2 |
+
|
| 3 |
+
AgriGround contains 14 instruction-tuning tasks spanning captioning, segmentation, localization, counting, conversation, and agricultural question answering. Counts below follow the current manuscript statistics and include both train and test samples.
|
| 4 |
+
|
| 5 |
+
## Task Distribution
|
| 6 |
+
|
| 7 |
+
| Task | Output supervision | Train | Test | Total | Share |
|
| 8 |
+
|---|---|---:|---:|---:|---:|
|
| 9 |
+
| Semantic segmentation | Text + masks | 1,651,229 | 422,187 | 2,073,416 | 18.15% |
|
| 10 |
+
| Phrase grounding | Bounding boxes | 1,638,327 | 418,948 | 2,057,275 | 18.01% |
|
| 11 |
+
| Referring expression segmentation | Text + masks | 1,638,327 | 418,948 | 2,057,275 | 18.01% |
|
| 12 |
+
| Part segmentation | Text + masks | 820,240 | 209,124 | 1,029,364 | 9.01% |
|
| 13 |
+
| Region-level conversation | Region + multi-turn text | 749,141 | 191,757 | 940,898 | 8.24% |
|
| 14 |
+
| Region-level captioning | Region + text | 722,833 | 185,023 | 907,856 | 7.95% |
|
| 15 |
+
| Classification QA | Text | 639,962 | 163,786 | 803,748 | 7.04% |
|
| 16 |
+
| Image-level captioning | Text | 400,872 | 102,587 | 503,459 | 4.41% |
|
| 17 |
+
| Grounded caption generation | Interleaved text + masks | 379,023 | 97,007 | 476,030 | 4.17% |
|
| 18 |
+
| Multi-turn grounded conversation | Multi-turn text + masks | 379,023 | 97,007 | 476,030 | 4.17% |
|
| 19 |
+
| Grounded counting | Count | 21,865 | 5,596 | 27,461 | 0.24% |
|
| 20 |
+
| Grounded detection | Count + bounding boxes | 21,637 | 5,535 | 27,172 | 0.24% |
|
| 21 |
+
| Reasoning detection | Count + bounding boxes | 21,637 | 5,535 | 27,172 | 0.24% |
|
| 22 |
+
| Negative absence QA | Text | 11,204 | 2,788 | 13,992 | 0.12% |
|
| 23 |
+
| **Total** | | **9,095,320** | **2,325,828** | **11,421,148** | **100%** |
|
| 24 |
+
|
| 25 |
+
## Task Definitions
|
| 26 |
+
|
| 27 |
+
### Captioning
|
| 28 |
+
|
| 29 |
+
**Image-level captioning** generates a holistic agricultural description without requiring spatial output.
|
| 30 |
+
|
| 31 |
+
**Region-level captioning** receives a specified image region and describes the localized agricultural content.
|
| 32 |
+
|
| 33 |
+
**Grounded caption generation** produces a detailed caption with grounded phrases interleaved with `[SEG]` tokens. Every grounded phrase is paired with a corresponding mask.
|
| 34 |
+
|
| 35 |
+
### Segmentation
|
| 36 |
+
|
| 37 |
+
**Referring expression segmentation** segments the object or region described by a natural-language expression.
|
| 38 |
+
|
| 39 |
+
**Semantic segmentation** segments one or more instances of a requested semantic category.
|
| 40 |
+
|
| 41 |
+
**Part segmentation** targets a specific plant or object component, such as a stem, branch, leaf, flower structure, or lesion.
|
| 42 |
+
|
| 43 |
+
### Detection and Localization
|
| 44 |
+
|
| 45 |
+
**Phrase grounding** maps a phrase to a normalized bounding box.
|
| 46 |
+
|
| 47 |
+
**Grounded counting** reports the number of requested agricultural objects in an image.
|
| 48 |
+
|
| 49 |
+
**Grounded detection** reports the count and normalized bounding boxes for all requested instances.
|
| 50 |
+
|
| 51 |
+
**Reasoning detection** uses an agricultural-context prompt to infer and localize the target instances.
|
| 52 |
+
|
| 53 |
+
### Conversation and QA
|
| 54 |
+
|
| 55 |
+
**Region-level conversation** supports follow-up questions about a selected image region.
|
| 56 |
+
|
| 57 |
+
**Multi-turn grounded conversation** combines image-level discussion with later phrase localization or segmentation.
|
| 58 |
+
|
| 59 |
+
**Classification QA** answers questions about species, diseases, pests, weeds, conditions, and other agricultural classes.
|
| 60 |
+
|
| 61 |
+
**Negative absence QA** teaches the model to state when a requested entity is not visible instead of producing an unsupported mask.
|
| 62 |
+
|
| 63 |
+
## Annotation Representation
|
| 64 |
+
|
| 65 |
+
The public schema will be documented with the annotation release. Records are expected to include an image reference, task identifier, user instruction, target response, and task-dependent spatial supervision such as masks, regions, or normalized bounding boxes.
|
images/annotation_pipeline.png
ADDED
|
Git LFS Details
|
images/architecture.png
ADDED
|
Git LFS Details
|
images/overview.png
ADDED
|
Git LFS Details
|
images/qualitative_gcg.png
ADDED
|
Git LFS Details
|
images/qualitative_tasks.png
ADDED
|
Git LFS Details
|
images/referring_segmentation_comparison.png
ADDED
|
Git LFS Details
|
images/task_examples_v3.png
ADDED
|
Git LFS Details
|