Giter VIP home page Giter VIP logo

amos2021ws06-exp-similarity-detector's Introduction

Banner

Explainable Similarity Detector

AMOS WS 2021/2022 - Project 6

amos2021ws06-exp-similarity-detector

Backend (Azure, Database, Machine Learning) / Frontend (Mendix)

Industry partner: Siemens AG


Similarity detector for electronic components on basis of Explainable AI


Table of contents


Description

The project goal is to develop a web service (frontend + backend) that lets users identify similar electronic components from a database using a machine learning algorithm.

Banner

Helpful links

Projects

Documentation

For the cooperation please follow the: Code Of Conduct.


Showcase

Demo Video

Amos-Demo-1.mp4

Login / Register

Login Register
Login Registration

Similarity Search

Similarity search

Added Components

Added-components

Suggest Component / Add Capacitor

Suggest Component Add Capacitor
Suggest similar Add capacitor

Software Architecture

Frontend

Software Architecture Frontend

Backend

Software Architecture Backend


Detailed Description

What was the overall Vision of our Project?

The Explainable Similarity Detector should give all developers who work with electronic components a noticeable simplification in everyday work. Through the use of machine learning and an easily understandable surface, the time-consuming search for suitable components should be faster, more convenient and clearer.

Problem Statement

Siemens AG uses millions of electronic components from various providers. It is not rare that very similar components are ordered from multiple providers which leads to cost inefficiency. The similarity of components is defined through their attributes. Depending on the type of components, the number of attributes can reach several hundreds. Also, the task is complicated by the fact that there is no naming conventions nor granularity standardization that are used by the component providers for describing the components: it is possible that an attribute defined by one provider can correspond to a differently named one or even several attributes defined by a different provider. Manual processing of such data would not only be infeasible due to data volumes but would also involve an enormous mental load assuming that the expert would have to compare all the attributes.

Solution

We want to provide a simple to use tool that allows an expert not only to detect similar or same components in the data but also reduce the mental load by providing an explanation in natural language of why certain components are similar and to what extent. Such a tool would not only ensure that similar components are found but will also create trust and transparency of the results, a feature that many modern ML tools are lacking. Providing an explanation of similarity will also reduce the mental load from the validation. The tool should be built around the existing deep learning model which we will provide. It should be able to gather feedback and trigger re-training of the model as the new annotations are supplied.

Resources

Siemens AG will provide the current implementation of explainable AI deep learning model in PyTorch. The model was inspired by the state-of-the-art machine translation approaches of neural encoder-decoder architectures and defines the task of explainable similarity detection as a translation task from tabular data into a natural language sentence that generates a text with the degree of similarity and its explanation.

Work Packages

Backend

The model should be integrated and deployed in a backend that will be communicating by a Rest API. It should make sure that it can process pairwise inputs as well as large lists of electronic components. The inference time of the model should be tested and optimized to ensure the optimal trade-off between cost and speed. The best deployment solution should be determined within the project with it potentially being deployed on the AWS with Kubernetes. The deployment should support inference and (re-)training. The backend should be cost-saving which means it should be able to scale automatically depending on the workload which means it should run on smaller instances when the workload is lower and access larger instances for heavy workloads. The backend should be able to compare the components within the list (Figure 1) as well as access a database of all the components and find the similar components among the existing once depending on the user’s preference.

Frontend

The frontend should be developed in framework of low-code platform Mendix. The frontend should communicate with the Backend by Rest API and be able to send and receive the data. It should visualize the output of the AI Model and allow the user to correct it. The corrected input should be sent back to the backend and stored for the further re-training of the model. The frontend should have at least following functionality:

  1. Upload a list of electronic components, list length between 2 and 10000
  2. Visualize the list in terms of pairwise comparison and the generated similarity annotations
  3. Create an export of the similarity pairing and automatically generated annotations
  4. Accept an import of a similarity pairwise comparison and gold standard human annotations to be further sent to the backend (e.g CSV, Excel)
  5. Allow annotations and feedback communication directly from the frontend

Feedback Pipeline

The user feedback from the frontend should be delivered back to the backend and updating of the model should be triggered. For this the implementation should ensure the following:

  1. Sanity checks and well-formedness of the annotations (e.g. handling of empty fields, spelling correction etc.)
  2. The training triggering on the corresponding resources e.g. inference (WP1) will be done for the sake of cost saving on CPUs, however, retraining should be triggered on GPUs.
  3. Validation of the new model. After the retraining the model should be tested to ensure that the results are not deteriorating due to the poor input data. Which means, the performance should be tested on the test set of the previous version as well as on the new data to ensure that the model does not overfit to the new data.
  4. If the results are satisfactory, the new model can be put into production. However, there should be versioning of the models and the fallback to the previous model should always be possible.

How do I benefit from this?

  • No more tedious searching for documentation
  • No more extensive comparisons of properties
  • Opportunity to give direct feedback
  • Possibility to specify similar components
  • Possibility to specify completely new components

Requirements

Functional Non-Functional
Identify a component Implementation of frontend via Mendix
Search for similar components Backend deployed on Azure
Save and export search results Communication via REST API
Comment on search results
Review user comments
Transmit comments to the database

amos2021ws06-exp-similarity-detector's People

Contributors

b4rtware avatar dirkriehle avatar georgir20 avatar h4nn3s94 avatar hemnemne avatar jasperjulius avatar re-krass avatar scoutatlas avatar t99-i avatar tucl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

amos2021ws06-exp-similarity-detector's Issues

Install Siemens Theme on project

User story

  1. As a {Developer}
  2. I want / need {to have a visually appealing and fitting user interface}
  3. So that {i can enjoy using the software}

Acceptance criteria

  • Siemens design theme works on the project

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

create API specification for Azure

evaluate which different end points need to be available to the front end. Should be based on the user stories and communicated with the front end team.

Refresh-Switch

User story

  1. As a {Developer}
  2. I want/need {to decide whether the results are updated continuously or manually}
  3. So that {I can search faster or optimize performance}

Acceptance criteria

  • can decide if i want to refresh automatically. If the option is enabled, then the results should refresh after every filter change

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Post request for single capacitors

User story

  1. As a {User}
  2. I want / need {to provide feedback on possible missing matching components}
  3. So that {I can improve the search in the future}

Acceptance criteria

  • A (single) object can be returned to the database.
  • The function can be called in a loop

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

restructuring in user feedback function frontend

User story

  1. As a {User}
  2. I want / need {to provide feedback on possible missing matching components}
  3. So that {I can improve the search in the future}

Acceptance criteria

  • User feedback function is working according to the specifications for communication between frontend and backend

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

create userrole: admin

User story

  1. As a {User}
  2. I want / need {I want to create and use the role of admin}
  3. So that {so that only I can see the added objects}

Acceptance criteria

  • Instead of a user, an admin can also be created as an account
  • Added objects can only be viewed by the admin

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Deserialize Return Message from ML-model Inference

User story

  1. As a {Developer}
  2. I want / need {A ranked list of functionally identical components (2nd source or substitute) calculated by the ML-model}
  3. So that {I can find the right component for a replacement}

Acceptance criteria

  • The string can be deserialized so that the individual components can be read out for further processing (height, price, ...)

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Create new users

User story

  1. As a {user}
  2. I want / need {to create new user-accounts}
  3. So that {to give users access}

Acceptance criteria

  • New user accounts can be created
  • User accounts can be used for login

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Host Mendix Docker Container on Azure

User story

  1. As a {Developer}
  2. I want / need {A ranked list of functionally identical components (2nd source or substitute)}
  3. So that {I can find the right component for a replacement}

Acceptance criteria

  • The Mendix frontend container is hosted on azure
  • The Mendix container can be reached

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Design Security Framework

evaluate the different options for achieving authorized access-only to our Azure-API.

keywords: token, JWT

Get request for a list of similar components

User story

  1. As a {Developer}
  2. I want / need {A list of components that are similar to ONE specific component}
  3. So that {I can find the right component for a replacement}

Acceptance criteria

  • One component can be entered for a similarity search
  • A list of similar components is returned for the user

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Filter based search

User story

  1. As a {Developer}
  2. I want/need {to search solely based on my filter setting}
  3. So that {I can find suitable components without specifying a start component}}

Acceptance criteria

  • I can get results based only on my filter settings

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Create first Domain Model with most important entities in mendix

User story

  1. As a {Developer}
  2. I want / need {A ranked list of functionally identical components (2nd source or substitute)}
  3. So that {I can find the right component for a replacement}

Acceptance criteria

  • A model is implemented in Mendix (section: "Domain Model"), which represents the properties of the objects

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Price and property comparison of similar components

User story

  1. As a {Procurement responsible}
  2. I want / need {to compare parts in terms of their properties (resistance, voltage, price range, etc.)}
  3. So that {so that I have to weigh up the costs and the effort involved in the replacement}

Acceptance criteria

  • Possibility of comparing individual properties between two similar components

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)s

Machine-Learning model connection (azure)

User story

  1. As a {Developer}
  2. I want / need {A ranked list of functionally identical components (2nd source or substitute) found by ML-algorithm}
  3. So that {I can find the right component for a replacement}

Acceptance criteria

  • can send data to frontend (frontend-connection)

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Filter results

User story

  1. As a {Developer}
  2. I want / need {to filter my results according to factors such as costs}
  3. So that {I can better find the best component for my application}

Acceptance criteria

  • Possibility to create filter-tab criteria for a search
  • filter-criteria is used in backend-search

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Function for adding component(resistor) (Dummy)

User story

  1. As a {User}
  2. I want / need {to provide a missing matching components(resistor)}
  3. So that {I can improve the search in the future}

Acceptance criteria

  • Information about the resistor can be entered in a pop-up window
  • The resistor is displayed in a list

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Create database-scheme (SQL)

User story

  1. As a {Project-Developer}
  2. I want / need {a databank scheme}
  3. So that {I can organize the data}

Acceptance criteria

  • The database represents all required data type

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Feedback Funktion

User story

  1. As a {User}
  2. I want / need {to provide feedback on possible missing matching components}
  3. So that {I can improve the search in the future}

Acceptance criteria

  • Possibility to give feedback in a separate window
  • Feedback is is received by backend

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Backend-API (Dummy)

User story

  1. As a {Project-Developer}
  2. I want / need {a Backend-API}
  3. So that {I am able to adress the backend from the frontend}

Acceptance criteria

  • Implement the Azure backend which corresponds to the open API specifications
  • Agree on format (further specification of open API)
  • Return of a JSON file
  • Adressable by frontend

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Tab system

User story

  1. As a {Developer}
  2. I want/need {to create multiple tabs}
  3. So that {I can search for multiple componets}

Acceptance criteria

  • can create multiple tabs, with independent search results and filters

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Split endpoint for retraining and adding of new components

User story

  1. As a {user}
  2. I want / need {to provide a missing matching components and add new components}
  3. So that {I can improve the search in the future}

Acceptance criteria

  • post end point for user suggestions (retraining) is implemented and input could be used for retraining the ML-model
  • post end point for adding new component is implemented

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Implementation of azure functions relying on database access

User story

  1. As a frontend-Developer
  2. I need to be able to call the backend API and get data from the database
  3. So that I am able to display that data in the frontend

Acceptance criteria

calling any of the 3 get endpoints (componentTypes, componentTypes/{type}, componentTypes/{type}/{id} queries our database for information, and returns that information in json format. this information may still be dummy information.
calling the post endpoint stores the transferred data in the corresponding sql table.

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Generalising Backend-API connection with the database (Dummy) for attributes

User story

  1. As a {Developer}
  2. I want / need {A ranked list of functionally identical resistors (2nd source or substitute) calculated by the ML-model}
  3. So that {I can find the right component for a replacement}

Acceptance criteria

  • The recognition of attributes is no longer hardcoded but decides directly on the basis of the transmitted type

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Functionality for finding similarities

User story

  1. As a {Developer}
  2. I want / need {A ranked list of functionally identical components (2nd source or substitute)}
  3. So that {I can find the right component for a replacement}

Acceptance criteria

  • Possibility of specifying a component and receiving suitable results

Definition of done

  • Added only after week 5
  • The same for all features

Backend-API connection with the database (Dummy)/Implementation of azure functions relying on database access (for resistors)

User story

  1. As a {Project-Developer}
  2. I want / need {a databank scheme}
  3. So that {I can organize the data}

Acceptance criteria

  • componentTypes is implemented
  • componentTypes/{type is implemented
  • componentTypes/{type}/{id is implemented
  • dummy-data can be received from the endpoints

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Add User feedback function to openAPI

User story

  1. As a {User}
  2. I want / need {to provide feedback on possible missing matching components}
  3. So that {I can improve the search in the future}

Acceptance criteria

  • Field for user-feedback is avaible

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Creation of a validation error object for POST operations in OpenAPI and implementation

User story

  1. As a {Developer}
  2. I want / need {A ranked list of functionally identical components (2nd source or substitute) calculated by the ML-model}
  3. So that {I can find the right component for a replacement}

Acceptance criteria

  • A valdiation error is displayed if something is wrong (or missing) with the input at the POST function

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Implementation of the endpoints

User story

  1. As a {Project-Developer}
  2. I want / need {to have access to the endpoints}
  3. So that {I can communicate with the Backend/Frontend}

Acceptance criteria

  • Information about the resistor can be entered in a pop-up window
  • The resistor displayed in a list

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Registration for anonymous users

User story

  1. As a {User}
  2. I want / need {I want to register as anonymous user}
  3. So that {so that only I use the software without revealing Information(Platzhalter)}

Acceptance criteria

  • users can be registered as anonymous users
  • anonymous users can log in and use the system(Platzhalter)

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Host Open-Api-Specification (Swagger)

User story

  1. As a {Project-Developer}
  2. I want / need {I want to see the specification of the open api interface}
  3. So that {I know how to use the API}

Acceptance criteria

  • API-Specification can be viewed in Swagger

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Request function for data (Dummy)

User story

  1. As a {Developer}
  2. I want / need {A ranked list of functionally identical components (2nd source or substitute)}
  3. So that {I can find the right component for a replacement}

Acceptance criteria

  • Possibility to enter data into a dummy-pop-up (Mendix)
  • send a get-request and get an answer

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Function for adding component(capacitor) (Dummy)

User story

  1. As a {User}
  2. I want / need {to provide a missing matching components(capacitor)}
  3. So that {I can improve the search in the future}

Acceptance criteria

  • Information about the capacitor can be entered in a pop-up window
  • The capacitor displayed in a list

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Get-Request (azure-Model) (Dummy-Backend)

User story

  1. As a {Developer}
  2. I want / need {A ranked list of functionally identical components (2nd source or substitute)}
  3. So that {I can find the right component for a replacement}

Acceptance criteria

  • Can send get-request for dummy-data

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Search result counter

User story

  1. As a {Developer}
  2. I want/need {to see how many results can be found with the current filter settings}
  3. So that {To get a better overview of the effect of my filter settings}

Acceptance criteria

  • I can see how many results i would get, with my current filter settings

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Implementation of azure function for ML-model inference (Dummy)

User story

  1. As a {Developer}
  2. I want / need {A ranked list of functionally identical components (2nd source or substitute)}
  3. So that {I can find the right component for a replacement}

Acceptance criteria

  • Calling the endpoint "GET .../" triggers the ML model component.
  • The ML-model already implements correct IO behaviour

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

(restructuring / adapting) of data and mapping

User story

  1. As a {Developer}
  2. I want / need {A ranked list of functionally identical components (2nd source or substitute)}
  3. So that {I can find the right component for a replacement}

Acceptance criteria

  • Data in the domain model has been adjusted to consistent state
  • Mapping in the domain model has been adjusted to consistent state
  • Attributes are adjusted
  • Popup for user that added component was only a suggestion
  • Remove ID Input Field for User

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Show Data Sheet

User story

  1. As a {Developer}
  2. I want/need {to display the data sheet belonging to the component (URL)}
  3. So that {I can get a quick overview of the component}

Acceptance criteria

  • i can open a link next to the result to open the documentation

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Backend-API connection with the database (Dummy)/Implementation of azure functions relying on database access (for capacitors)

User story

  1. As a {Project-Developer}
  2. I want / need {an API-Scheme}
  3. So that {I can handel data requests}

Acceptance criteria

  • componentTypes is implemented
  • componentTypes/{type is implemented
  • componentTypes/{type}/{id is implemented
  • dummy-data can be received from the endpoints

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Subsequent editing of entries in the list

User story

  1. As a {Admin}
  2. I want / need {I want to edit entries in the component list}
  3. So that {so that i can delete or correct entries}

Acceptance criteria

  • The admin has the possibility to edit any entries from the list of all components

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

create JSON-Format/create Open-API-specification

Format definieren

User story

  1. As a {Project-Developer}
  2. I want / need {a JSON-Format}
  3. So that {I have a format to transfer data between server and the web application}

Acceptance criteria

  • The JSON-Format includes all important information required for communication between frontend and backend

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Allocation of results in classes

User story

  1. As a {Developer}
  2. I want / need {an allocation of the components in the classes "worst in class", "average in class" and "best in class"}
  3. So that {so that I can better classify the results}

Acceptance criteria

  • Allocation of all three classes when a result is returned

Definition of done

  • Code has been reviewed by developer
  • Code has been reviewed by the responsible developer Team (Frontend/Backend)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.