An interactive dashboard for visualisation, integration and classification of data using Active Learning.

Overview

Build Status codecov Documentation Status

DOI

AstronomicAL

An interactive dashboard for visualisation, integration and classification of data using Active Learning.

AstronomicAL is a human-in-the-loop interactive labelling and training dashboard that allows users to create reliable datasets and robust classifiers using active learning. The system enables users to visualise and integrate data from different sources and deal with incorrect or missing labels and imbalanced class sizes by using active learning to help the user focus on correcting the labels of a few key examples. Combining the use of the Panel, Bokeh, modAL and SciKit Learn packages, AstronomicAL enables researchers to take full advantage of the benefits of active learning: high accuracy models using just a fraction of the total data, without the requirement of being well versed in underlying libraries.

Load Configuration

Statement of Need

Active learning (Settles, 2012) removes the requirement for large amounts of labelled training data whilst still producing high accuracy models. This is extremely important as with ever-growing datasets; it is becoming impossible to manually inspect and verify ground truth used to train machine learning systems. The reliability of the training data limits the performance of any supervised learning model, so consistent classifications become more problematic as data sizes increase. The problem is exacerbated when a dataset does not contain any labelled data, preventing supervised learning techniques entirely. AstronomicAL has been developed to tackle these issues head-on and provide a solution for any large scientific dataset.

It is common for active learning to query areas of high uncertainty; these are often in the boundaries between classes where the expert's knowledge is required. To facilitate this human-in-the-loop process, AstronomicAL provides users with the functionality to fully explore each data point chosen. This allows them to inject their domain expertise directly into the training process, ensuring that asigned labels are both accurate and reliable.

AstronomicAL has been extensively validated on astronomy datasets. These are highly representative of the issues that we anticipate will be found in other domains for which the tool is designed to be easily customisable. Such issues include the volume of data (millions of sources per survey), vastly imbalanced classes and ambiguous class definitions leading to inconsistent labelling. AstronomicAL has been developed to be sufficiently general for any tabular data and can be customised for any domain. For example, we provide the functionality for data fusion of catalogued data and online cutout services for astronomical datasets.

Using its modular and extensible design, researchers can quickly adapt AstronomicAL for their research to allow for domain-specific plots, novel query strategies, and improved models. Furthermore, there is no requirement to be well-versed in the underlying libraries that the software uses. This is due to large parts of the complexity being abstracted whilst allowing more experienced users to access full customisability.

As the software runs entirely locally on the user's system, AstronomicAL provides a private space to experiment whilst providing a public mechanism to share results. By sharing only the configuration file, users remain in charge of distributing their potentially sensitive data, enabling collaboration whilst respecting privacy.

Documentation

The documentation for AstronomicAL can be found here.

Installation

To install AstronomicAL and its dependencies, the user can clone the repository and from within the repo folder run pip install -r requirements.txt. . It is recommended that the user creates a virtual environment using tools such as Virtualenv or Conda, to prevent any conflicting package versions.

    git clone https://github.com/grant-m-s/AstronomicAL.git
    cd AstronomicAL
    conda config --add channels conda-forge
    conda create --name astronomical --file requirements.txt
    conda activate astronomical

Quickstart Instructions

To begin using the software, run bokeh serve astronomicAL --show and your browser should automatically open to localhost:5006/astronomicAL

AstronomicAL provides both an example dataset and an example configuration file to allow you to jump right into the software and give it a test run.

Load Configuration

To begin training you simply have to select Load Custom Configuration checkbox and select your config file. Here we have chosen to use the example_config.json file.

The Load Config Select option allows use to choose the extent to which to reload the configuration.

Contributing to AstronomicAL

Reporting Bugs

If you encounter a bug, you can directly report it in the issues section.

Please describe how to reproduce the bug and include as much information as possible that can be helpful for fixing it.

Are you able to fix a bug?

You can open a new pull request or include your suggested fix in the issue.

Submission of extensions

Have you created an extension that you want to share with the community?

Create a pull request describing your extension and how it can improve research for others.

Support and Feedback

We would love to hear your thoughts on AstronomicAL.

Are there any features that would improve the effectiveness and usability of AstronomicAL? Let us know!

Any feedback can be submitted as an issue.

Referencing the Package

Please remember to cite our software and user guide whenever relevant.

See the Citing page in the documentation for instructions about referencing and citing the astronomicAL software.

Comments
  • Parameter errors when attempting to set up a training set

    Parameter errors when attempting to set up a training set

    Hi there,

    I have been attempting create a training set of color magnitude diagrams with astronomicAL and after a few iterations of importing data as both .csv and .fits files I keep running into the following errors and was wondering if these are specifically related to how I am using astronomicAL. I have created a column with integer labels 0-5 corresponding to galaxy shapes and have been using these as my Label and ID columns respectively. Any assistance or guidance would be appreciated and thank you for your help!

    Best, Max

    Error when launching astronomicAL (due to renamed class in newer versions of pandas?) pandas could not register all extension types imports failed with the following error: cannot import name 'ABCIndexClass' from 'pandas.core.dtypes.generic

    Errors when I attempt to view a basic plot after setting my parameters raise ValueError("%s not in parameter%s's list of possible objects, " ValueError: absMag_u_tot-absMag_g_tot not in parameter Y_variable's list of possible objects, valid options include [id, ebv, r_aper, absMag_u_tot, err_u, absMag_g_tot, err_g, absMag_r_tot, err_r, absMag_i_tot, err_i, absMag_z_tot, err_z, isTyphon, col1_1, col2_1, col3_1, col4_1, Official_name, Old_name, VCC_name, VCC_membership, VCC_Bmag, TH_name, sep_2, ...]

    /Users/mkurzner/opt/anaconda3/lib/python3.9/site-packages/bokeh/server/protocol_handler.py:94: RuntimeWarning: coroutine 'WSHandler.send_message' was never awaited work = connection.error(message, repr(e))

    opened by mkurzner 9
  • [JOSS Review] Tests

    [JOSS Review] Tests

    This issue is part of the JOSS review going on in openjournals/joss-reviews#3635.

    The tests/ directory contains 122 tests, but lacks organization. Suggested changes are:

    1. Split the test file into several individual files such that each sub-module has its own test file with just a few tests. This change is optional since JOSS doesn't require a specific structure to the test suite, but it may help users.
    2. When I ran the tests, 32 failed. I suggest looking into the failures or skipping them at runtime with a provided reason. The test summary from my run is attached below. To verify that all the functionalities of the software are working properly, I would like to get to the bottom of why the tests don't pass.
    FAILED all_test.py::TestSettings::test_data_selection_check_config_load_level_no_load_config - FileNotFoundError: [Errno 2]...
    FAILED all_test.py::TestDashboards::test_dashboard_closing_button_check_contents[Settings] - ValueError: PNG pane cannot pa...
    FAILED all_test.py::TestDashboards::test_selected_source_init_selected - _pickle.PicklingError: Can't pickle <function Colu...
    FAILED all_test.py::TestDashboards::test_selected_source_check_history_from_none_to_selected - _pickle.PicklingError: Can't...
    FAILED all_test.py::TestDashboards::test_selected_source_check_history_from_selected_to_selected_unique - _pickle.PicklingE...
    FAILED all_test.py::TestDashboards::test_selected_source_check_history_from_selected_to_selected_same_id_head - _pickle.Pic...
    FAILED all_test.py::TestDashboards::test_selected_source_check_history_from_selected_to_selected_no_id - _pickle.PicklingEr...
    FAILED all_test.py::TestDashboards::test_selected_source_check_history_from_selected_to_selected_same_id_throughout - _pick...
    FAILED all_test.py::TestDashboards::test_selected_source_empty_selected_from_selected - _pickle.PicklingError: Can't pickle...
    FAILED all_test.py::TestDashboards::test_selected_source_check_valid_select_from_selected_is_valid - _pickle.PicklingError:...
    FAILED all_test.py::TestDashboards::test_selected_source_search_valid_id - _pickle.PicklingError: Can't pickle <function Co...
    FAILED all_test.py::TestDashboards::test_selected_source_search_deselect - _pickle.PicklingError: Can't pickle <function Co...
    FAILED all_test.py::TestDashboards::test_selected_source_update_default_images - _pickle.PicklingError: Can't pickle <funct...
    FAILED all_test.py::TestDashboards::test_selected_source_update_custom_images - _pickle.PicklingError: Can't pickle <functi...
    FAILED all_test.py::TestDashboards::test_settings_dashboard_init - ValueError: PNG pane cannot parse string that is not a f...
    FAILED all_test.py::TestDashboards::test_settings_dashboard_close_settings - ValueError: PNG pane cannot parse string that ...
    FAILED all_test.py::TestDashboards::test_settings_dashboard_pipeline_previous - ValueError: PNG pane cannot parse string th...
    FAILED all_test.py::TestDashboards::test_settings_dashboard_pipeline_next - ValueError: PNG pane cannot parse string that i...
    FAILED all_test.py::TestDashboards::test_settings_dashboard_close_button_check_disabled - ValueError: PNG pane cannot parse...
    FAILED all_test.py::TestDashboards::test_settings_dashboard_get_settings - ValueError: PNG pane cannot parse string that is...
    FAILED all_test.py::TestDashboards::test_AL_dashboard_labels_to_train_single - ValueError: No plotting extension is current...
    FAILED all_test.py::TestDashboards::test_AL_dashboard_labels_to_train_multiple - ValueError: No plotting extension is curre...
    FAILED all_test.py::TestDashboards::test_labelling_dashboard_init - ValueError: No plotting extension is currently loaded. ...
    FAILED all_test.py::TestDashboards::test_labelling_dashboard_check_single_matching_value_in_region - ValueError: No plottin...
    FAILED all_test.py::TestDashboards::test_labelling_dashboard_check_multiple_matching_values_in_region - ValueError: No plot...
    FAILED all_test.py::TestDashboards::test_labelling_dashboard_check_combined_matching_values_in_region - ValueError: No plot...
    FAILED all_test.py::TestDashboards::test_labelling_dashboard_removing_sample_criteria - ValueError: No plotting extension i...
    FAILED all_test.py::TestDashboards::test_labelling_dashboard_check_looping_through_labelled - ValueError: No plotting exten...
    FAILED all_test.py::TestDashboards::test_labelling_dashboard_check_new_button_with_single_match - ValueError: No plotting e...
    FAILED all_test.py::TestDashboards::test_labelling_dashboard_check_zero_matching - ValueError: No plotting extension is cur...
    FAILED all_test.py::TestDashboards::test_labelling_dashboard_save_assigned_label - ValueError: No plotting extension is cur...
    FAILED all_test.py::TestUtils::test_save_config_save_config_file - ValueError: PNG pane cannot parse string that is not a f...
    ======================================== 32 failed, 90 passed, 19 warnings in 16.04s =========================================
    
    opened by rmorgan10 9
  • [JOSS Review] Installation

    [JOSS Review] Installation

    This issue is part of the JOSS review going on in https://github.com/openjournals/joss-reviews/issues/3635.

    At present, the installation instructions are inaccurate. After cloning, users need to enter the command cd astronomicAL such that the environment creation command can access the requirements.txt file. Adding this command to the instructions will be sufficient to satisfy the JOSS installation specifications.

    That being said, I think the better way to go about installation would be to make your package available on PyPI. The motivation here is to enable users to be able to use astronomicAL in any directory they are working in as opposed to having to move their work to the location of the cloned repository. This change is optional, but could make astronomicAL much more portable.

    opened by rmorgan10 8
  • [JOSS Review] Paper

    [JOSS Review] Paper

    This issue is part of the JOSS review going on in https://github.com/openjournals/joss-reviews/issues/3635.

    The paper is well written and does an excellent job of introducing astronomicAL. I think two aspects of the paper can be improved.

    1. The state of the field discussion seems to be missing. Perhaps some examples where active learning has been applied would be helpful here.

    2. The statement of need section seems to list the features of astronomicAL as opposed to demonstrating why it is a needed piece of software. I'm aware that there is significant need for a tool like this, but I think that fact could be communicated better in the paper. For instance, when you add a more descriptive state of the field, that discussion will lend itself nicely to introducing the reason the field needs astronimcAL.

    opened by rmorgan10 5
  • How to use this for Image Labelling?

    How to use this for Image Labelling?

    Hi guys!

    I was following the README.md file but couldn't quite figure out whether this could be used for labelling images and subsequntly building image classification models.

    Any help would be appreciated. Thanks! :)

    Regards, Vinayak.

    enhancement question 
    opened by ElisonSherton 2
  • [JOSS Review] General Documentaion

    [JOSS Review] General Documentaion

    This issue is part of the JOSS review going on in openjournals/joss-reviews#3635.

    The methods are sufficiently documented given that users interact with astronomicAL through the interactive browser as opposed to directly with the API. The tutorials are very helpful in this regard.

    Just one thing is missing to satisfy JOSS requirements:

    1. Community guidelines for how people can contribute, report issues, and seek support. Generally, just a short paragraph in the README will satisfy this requirement.
    opened by rmorgan10 2
  • Documentation & Fixes

    Documentation & Fixes

    Majority of Documentation Tutorials have now been updated.

    Small fixes:

    • ensure ml data is shared across all classifiers
    • reassign index after applying scaling
    opened by grant-m-s 1
  • Code Changes From User Feedback

    Code Changes From User Feedback

    1.Added SED plots for astronomy classification

    • User can load in a photometry band file containing mean wavelength, full width half maximum (FWHM) and magnitude error values. These can be assigned specific values or assigned column names where the corresponding value will be retrieved when plotted.
    • Users can create these files through AstronomicAL and assign which features shouuld be used for the SED plot. By default all features are included in the file but are assigned -99 (indicating they shouldn't be plotted).
    • data/sed_data/example_photometry_bands.json added to work with example dataset and config.
    1. When exporting a configuration, the classifiers will export raw labels from the user rather than one-vs-rest converted ones.
    • The conversion back to one-vs-rest happens on loading the configuration file.
    • The models themselves still see one-vs-rest labels (1 if assigned class, 0 otherwise).
    1. Removed unknowns (label = -1) from performance metrics and initial starting point selection.
    • The logic initially was to set all labels that were -1 to 0 for performance metrics and starting points for each classifier but due to (2) this prevented the conversion back to original values as it wasn't possible to know whether the point was in the initial starting points or not.
    1. Show/hide incorrect and correct points in train and validation performance plots.

    2. Export to Fits file button added

    • Allowing for assigned labels in all classifiers as well as labelling mode to be saved as Fits file containing the id and assigned label of that point.
    1. Removed many print statements

    2. Various bug fixes

    opened by grant-m-s 1
  • Images as separate process

    Images as separate process

    Using multiprocessing.Process, images are now loaded on a separate process to prevent lag on the rest of the system.

    Test also updated to allow for change.

    opened by grant-m-s 1
  • Interactive labelling

    Interactive labelling

    Split into two separate modes: Active Learning Mode (same as original) and Labelling Mode (used to created hand labelled test sets)

    Also includes:

    • View test set results
    • Added default dataset and config_file
    • updated documentation
    • update testing
    opened by grant-m-s 1
  • Config collaboration

    Config collaboration

    Users can now load configuration files for layouts, settings or full training reproducibility.

    Also change include:

    • Autosaving of training labels to allow for easy restart of project.
    • Unnecessary imports removed.
    • Increased Tests in settings.
    • Improved default layout
    • Added checks for optical and radio images to prevent crashes due to website outages.
    opened by grant-m-s 1
  • AstronomicAL V2: Deep Learning and Image Update

    AstronomicAL V2: Deep Learning and Image Update

    Upcoming features:

    Machine Learning Updates

    • [ ] Full Pytorch Model Support

      • [ ] Training
      • [ ] Save/Load Model
    • [ ] Full Tensorflow Model Support

      • [ ] Training
      • [ ] Save/Load Model
    • [ ] Image Dataset Incorporation

    • [ ] Model Exploration Views

      • [ ] Saliency Maps
      • [ ] Weight Visualisation
      • [ ] Occlusion Maps
    • [ ] Incorporate Stopping Criteria into training

    • [ ] Allow cross-val to produce uncertainties during training

    UI/UX Improvements

    • [ ] Improve layout template
    • [ ] Allow dynamic dashboard creation and removal

    Various Bug Fixes

    • [ ] Improve handling train, val, test splits for small and very imbalanced datasets #16
    enhancement 
    opened by grant-m-s 0
Releases(v1.0)
Owner
Interactive AI PhD student from the University of Bristol
Compute and visualise incidence (reworking of the original incidence package)

incidence2 incidence2 is an R package that implements functions and classes to compute, handle and visualise incidence from linelist data. It refocuss

15 Nov 22, 2022
Analytical Web Apps for Python, R, Julia, and Jupyter. No JavaScript Required.

Dash Dash is the most downloaded, trusted Python framework for building ML & data science web apps. Built on top of Plotly.js, React and Flask, Dash t

Plotly 17.9k Dec 31, 2022
Visualizations of linear algebra algorithms for people who want a deep understanding

Visualising algorithms on symmetric matrices Examples QR algorithm and LR algorithm Here, we have a GIF animation of an interactive visualisation of t

ogogmad 3 May 05, 2022
Shaded 😎 quantile plots

shadyquant 😎 This python package allows you to quantile and plot lines where you have multiple samples, typically for visualizing uncertainty. Your d

Mehrad Ansari 13 Sep 29, 2022
Profile and test to gain insights into the performance of your beautiful Python code

Profile and test to gain insights into the performance of your beautiful Python code View Demo - Report Bug - Request Feature QuickPotato in a nutshel

Joey Hendricks 138 Dec 06, 2022
Apache Superset is a Data Visualization and Data Exploration Platform

Apache Superset is a Data Visualization and Data Exploration Platform

The Apache Software Foundation 49.9k Jan 02, 2023
3D-Lorenz-Attractor-simulation-with-python

3D-Lorenz-Attractor-simulation-with-python Animação 3D da trajetória do Atrator de Lorenz, implementada em Python usando o método de Runge-Kutta de 4ª

Hevenicio Silva 17 Dec 08, 2022
DataVisualization - The evolution of my arduino and python journey. New level of competence achieved

DataVisualization - The evolution of my arduino and python journey. New level of competence achieved

1 Jan 03, 2022
Data Visualizer for Super Mario Kart (SNES)

Data Visualizer for Super Mario Kart (SNES)

MrL314 21 Nov 20, 2022
Designed a greedy algorithm based on Markov sequential decision-making process in MATLAB/Python to optimize using Gurobi solver

Designed a greedy algorithm based on Markov sequential decision-making process in MATLAB/Python to optimize using Gurobi solver, the wheel size, gear shifting sequence by modeling drivetrain constrai

Sabbella Prasanna 1 Jan 11, 2022
Political elections, appointment, analysis and visualization in Python

Political elections, appointment, analysis and visualization in Python poli-sci-kit is a Python package for political science appointment and election

Andrew Tavis McAllister 9 Dec 01, 2022
CONTRIBUTIONS ONLY: Voluptuous, despite the name, is a Python data validation library.

CONTRIBUTIONS ONLY What does this mean? I do not have time to fix issues myself. The only way fixes or new features will be added is by people submitt

Alec Thomas 1.8k Dec 31, 2022
3D plotting and mesh analysis through a streamlined interface for the Visualization Toolkit (VTK)

PyVista Deployment Build Status Metrics Citation License Community 3D plotting and mesh analysis through a streamlined interface for the Visualization

PyVista 1.6k Jan 08, 2023
Create SVG drawings from vector geodata files (SHP, geojson, etc).

SVGIS Create SVG drawings from vector geodata files (SHP, geojson, etc). SVGIS is great for: creating small multiples, combining lots of datasets in a

Neil Freeman 78 Dec 09, 2022
Parse Robinhood 1099 Tax Document from PDF into CSV

Robinhood 1099 Parser This project converts Robinhood Securities 1099 tax document from PDF to CSV file. This tool will be helpful for those who need

Keun Tae (Kevin) Park 52 Jun 10, 2022
Comparing USD and GBP Exchange Rates

Currency Data Visualization Comparing USD and GBP Exchange Rates This is a bar graph comparing GBP and USD exchange rates. I chose blue for the UK bec

5 Oct 28, 2021
This is a Web scraping project using BeautifulSoup and Python to scrape basic information of all the Test matches played till Jan 2022.

Scraping-test-matches-data This is a Web scraping project using BeautifulSoup and Python to scrape basic information of all the Test matches played ti

Souradeep Banerjee 4 Oct 10, 2022
Streamlit component for Let's-Plot visualization library

streamlit-letsplot This is a work-in-progress, providing a convenience function to plot charts from the Lets-Plot visualization library. Example usage

Randy Zwitch 9 Nov 03, 2022
This repository contains a streaming Dataflow pipeline written in Python with Apache Beam, reading data from PubSub.

Sample streaming Dataflow pipeline written in Python This repository contains a streaming Dataflow pipeline written in Python with Apache Beam, readin

Israel Herraiz 9 Mar 18, 2022
A Scheil-Gulliver simulation tool using pycalphad.

scheil A Scheil-Gulliver simulation tool using pycalphad. import matplotlib.pyplot as plt from pycalphad import Database, variables as v from scheil i

pycalphad 6 Dec 10, 2021