• Nenhum resultado encontrado

‘Here We Are’

N/A
N/A
Protected

Academic year: 2024

Share "‘Here We Are’ "

Copied!
93
0
0

Texto

In addition, I would like to thank my two friends, Afrodita Tzifa and Ioannis Mourelatos, for being so understanding and supportive when it was difficult. Our goal is to create a new application that is easy to use, safe, fast and also includes a sketch and photos in the traffic statement.

APPLICATIONS LIKE “HERE WE ARE”

  • Web Forms
  • Mobile App Assisto: Report Your Car Accident
  • Car Damage Recognition by Altoros
  • Claim Genius

Claim genius is a mobile application that uses artificial intelligence technology instead of image analysis to predict the repair estimate and suggest repairing or replacing the damaged part of the vehicle.

WHAT DOES “HERE WE ARE” APP OFFER MORE?

SERVICE-ORIENTED ARCHITECTURE

  • CONTAINERS
    • Container History
  • DOCKER
    • Docker History
    • Docker Desktop
    • Docker Vocabulary
  • MICROSERVICES
    • Microservices History and Future
    • Benefits and Challenges of Microservices
  • ORCHESTRATION OF MICROSERVICES
  • KUBERNETES
    • Kubernetes History
    • Kubernetes Vocabulary
    • What Does Kubernetes?

Use of different technologies: Each service can be written in the language that best suits and makes use of the appropriate database, relational or non-relational. Updating services that are essential to other services in the application should not break them.

OTHER TECHNOLOGIES IN ‘HERE WE ARE’ APP

BACK-END APPLICATION

  • Python
    • Pros and Cons of Python
    • Python History
  • FastAPI Framework
    • Pros and Cons of FastAPI framework
    • FastAPI History
  • Tensorflow Library
    • TensorFlow History
  • SQLAlchemy

In January 1994, Python 1.0 was released, and Van Rossum said "Python gained lambda, reduce(), filter(), and map(), courtesy of a Lisp hacker who missed them and submitted working patches. In December 2008 Python 3.0 was released and it was the first language to break backwards compatibility.

DATABASE

  • PostgreSQL

FRONT-END

  • React
    • React History
    • React Now
  • Redux

React Fiber was released in April 2017 and replaced Stack, until then React's rendering algorithm. React hooks were introduced as part of React 16.8 in February 2019 and support a new, lighter way of handling component logic and behavior.

MACHINE LEARNING

SUPERVISED LEARNING

Recall is the fraction of true positive predictions among the sum of true positives and false negatives. Precision is the ratio of true positive predictions to total positive predictions (true positives plus false positives).

UNSUPERVISED LEARNING

Accuracy is the quotient of the number of correct predictions (true positive and true negative) over the total number of predictions. It shows the model's ability to show real positives that are actually real positives.

OVERFITTING

CONVOLUTIONAL NEURAL NETWORKS

CREATING MODELS IN TENSORFLOW.KERAS

Dense refers to a layer -every neuron is connected to every neuron- that is added to the model. Conv2D refers to the number of filter values ​​used for each image to train the model and to the input of the images (width, height, number of colors).

THE FLOW TO GIVE A PREDICTION

Callbacks in Keras are functions that can be activated when the model has the best stat or the least loss in one epoch. The second check includes 2300 images, which are also equally divided into two classes: “damaged” and “whole”.

CREATED MODELS – IT DOES NOT ALWAYS WORK

  • First model – Sequential
  • Second model – InceptionV3

The average size of images in this model is 211*262 and the model is fed with colored images. Early stops are used when the model does not show smaller losses in validation data for 5 consecutive periods, restoring the best weights it got during training. Fit generator gets train image generator and test image generator to train the model for 100 epochs.

Average size of images in this model is 221*319 and the model is color image feed. Fit generator gets train image generator and test image generator to train the model for 250 epochs. Average size of images in this model is 224*224 and the model is color image feed.

The Fit generator takes the train image generator and the test image generator to train the model for 150 epochs. The average size of the images in this template is 193*263 and the template is supplied with color images. Early stops are used when the model shows no smaller loss on the validation data for 30 consecutive epochs, returning the best weights it obtained during training.

CREATING THE APPLICATION

CREATE APPLICATION FLOW

DEVELOPING EACH CONTAINER

When all containers are running, the "Containers/Apps" and "Images" docker pages should contain them with an indication that they are "IN USE".

AUTHENTICATION MICROSERVICES

App checks the uniqueness of email and username and then generates text, known as salt, to hash user password and stores them in the database and returns a token to the user of JWT library based on username. Admin is the manager of the flow of the app, who intervenes when any of the previous roles cause problems. Column user_id, as depicted in the schema, is a foreign key that references the user table in the id column.

The UserPublic model as stated in user models includes the user's profile data, so the response to get-current-user is as follows:

ACCIDENT STATEMENT MICROSERVICE

The database contains 9 tables: vehicles, insurance, insurance company, roles, accident, accident report, accident report_sketch, accident report_image and temporapy_accident_driver_data. The insurance company table includes all the insurance companies from which the user can obtain car insurance. It is filled in with data from the accident report table and data for the resting drivers who have been declared as participants in the accident.

In the accident statement there is a car_damage column that stores the prediction of the other microservice, if it is used. The Accident_statement_images table contains photos of the accident that users have provided, and accident_statement_sketch has a list of coordinates of the user's sketch, stored as a string. If the user represents an insurance company (is_superuser), he can get all vehicles last insured with the same insurance company.

User can set an accident statement as "done=True" as long as they have filled in all the necessary fields, added their sketch, photos and the other driver of the accident. When saved as True, no changes can be made to the accident statement and the accident statement_sketch or more accident statement photos. A driver cannot make an accident declaration if they did not have valid insurance for the vehicle up to date at the time of the accident.

VEHICLE DAMAGE DETECTION MICROSERVICE

If a driver has made an accident statement, he cannot add a new statement, but only update the current one. On a multipart/form-data call, it gets an image as a file and stores it in the database as a binary string. Upon vehicle damage detection, the user adds an image to get an answer about the damage the app has detected.

This answer comes from the aforementioned selected model as described in the previous chapter. Due to the small number of damaged vehicles, the application saves the photos to generate more efficient models in the future. If the first model does not detect a car, the user gets the message “Sorry, I can't see any vehicle damage.

Otherwise, if damage is detected, the image goes to the second model, which predicts whether the damage is on the door, bumper, glass, headlight, taillight or, if it is a major damage in the car, on the front, back or side.

FRONT END: REACT @ REDUX

  • How Redux works?

Due to the many api calls, additional functions were created to make these requests faster and easier to code.

KUBERNETES

To get greater independence of the pods to the database containers, persistent volumes will be created. Hereweare-postgres-secret referenced below is another object that includes the environment variables from a secret file whose name is "postgres-secret". Make create-local-cluster starts minicube, creates the "here-we-are" cluster and the three persistent volumes for the databases.

Here we see that all deployments work with all pods, while pre-deployment had to restart 2 times.

CONCLUSIONS

PROBLEMS CREATING THE APP

FUTURE WORKS ON ‘HERE WE ARE’

21] Frederic Lardinois (2015), As Kubernetes Hits 1.0, Google Donates Technology to Newly Formed Clous Native Computing Foundation, accessed August 28, 2021, TechCrunch, techcrunch.com as-kubernetes-hits-1-0-google-donates-technology - after-reformed-cloud-native-computing-foundation-with-ibm-intel-twitter-and-others/. 24] Maximilian Schwarzmüller (2020), Docker & Kubernetes: The Practical Guide, udemy.com/course/docker-kubernetes-the-practical-. 25] Business Browdaway (2020), Bob Hayes, Usage of Programming by Data Scientists: Python Grows while R Weakens, Accessed August 14, 2021, businessoverbroadway.com usage-of-programming-languages-by-data-scientists-python- grow- while-r-weakened/.

27] BoTreeTechnologies(2020), Parth Barrot, Pros and Cons of PythonL A Clear Python Web Development Guide, accessed August 14, 2021, Tntra, www.botreetechnologies.com/blog/pros-and-cons-of-python/. 30] The Register(2018), Simon Sharwood, Python creator Guido van Rossum sys.exit()s as language lord, accessed September 4, 2021. 31] The Netflix Tech Blog (2020), Kevin Glisson, Marc Vilanova, Forest Monsen , Introducing Dispatch, accessed September 4, 2021, Netflix,.

45] Redux, Dan Abramov and the Redux documentation authors, React-Redux, Accessed September 7, 2021, react-redux.js.org/. 50] IBM Cloud Education (2021), Convolutional Neural Network, Accessed September 12, 2021, www.ibm.com/cloud/learn/convolutional-neutal-networks [51] Keras Backend, Accessed September 12, 2021, faroit.com/ keras- . 52] Machine Learning Mastery (2019), Jason Brownlee, Use Weight Regularization to Reduce Overfitting of Deep Learning Models, Accessed September 12, 2021, machinelearningmastery.com/weight-regularization-to-reduce-overfitting-of-deep-learning-models / .

USER INTERFACE

On the right side of the screen you can see the vehicles you have added. So if you have filled out the form correctly, when you press Add vehicle, you will be redirected to the vehicle page to update info about the insurance and if you are the owner of the vehicle. So, if you have filled out the form correctly, when you press Report accident, you will be redirected to the accident page, to make your accident report, add sketch, photos and the other drivers involved in the accident.

To view it, you can select an image from the Select Image option and press "Open Image". If you press the “+” button, the pending statements will show the driver who did not use the page to respond to the accident statement. If you want, you can add another driver or delete one if he didn't make an accident statement.

To use damage detection, select the link in the accident report or use the navigation. It then asks if you want to add the forecast to the accident statement you made. The crash information page already contains the crash and has a warning that the user needs to add a crash statement.

Referências

Documentos relacionados