Skip to content
Lukas Mueller edited this page Nov 21, 2024 · 9 revisions

Automated Image Analysis

Introduction

Images stored in Breedbase can be subjected to automated analyses using a standardized protocol and store the results, usually keyed to a trait, into the database.

User interface

The user interface to submit images to analysis is available on Breedbase at the URL /tools/image_analysis.

Images can be queried and selected from a list

image_analysis_select

Then users can pick an analysis service to submit them to

image_analysis_submit

The analysis services are currently defined in mason/tools/image_analysis.mas. This should be refactored into an entry in sgn_local.conf.

Analysis progress is reported

image_analysis_progress

Then results are displayed for review, with the option to save the scores as new phenotypes.

image_analysis_results

Backend implementation

JSON call format

The structure of the call is defined as follows:

my $resp = $ua->post(
      "http://unet.mcrops.org/api",
      Content_Type => 'form-data',
      Content => [
          image => [
            '/home/production/volume/public/images/image_files_test/5b/73/32/47/f52d22ee4227e1c9049ef4b8/image-3.png',
            Content_Type => 'image/png'
          ],
      ]
    );

JSON return format

{
               'image_name' => 'Sr9GHXyXCN_nrVV13r.JPG',
               'trait_value' => '33.75',
               'image_link' => 'http://unet.mcrops.org/api_results/Sr9GHXyXCN_nrVV13r.png',
               'trait_name' => 'CBSDpct | CO_334:0002078'
};

Multi-object images (Data structure proposal)

Sometimes images contain multiple objects, such as multiple fruits, tissue extracts, roots, etc. that should be analyzed separately.

As a discussion starting point, the workflow could be implemented with the submission of one image, but several images could be returned, along with several scores, as well as a composite score with standard errors; for each returned image, a new tissue sample would have to be created on the fly that is associated with the current observation unit. (Of course other workflows are possible).

For the RESTful call, the current observation unit name should also be added as a parameter.

{
               'image_name' => 'Sr9GHXyXCN_nrVV13r.JPG',
               'trait_name' =>  'CBSDpct | CO_334:0002078',
               'trait_value' => '33.75',
               'trait_standard_error' => '3.8',
               
               results => {
                  <current_observation_unit_name>_sample_1 => {
                     'image_link' => 'http://unet.mcrops.org/api_results/Sr9GHXyXCN_nrVV13r.png',
                     'trait_value' => '32.10',
                   },

                   <current_observation_unit_name>_sample_2 => {
                      ...
                   },
                },

};