Smooth teeth, C ++ and math - how are they related? Conversation with Align
Sometimes it seems to me that the more I look at the IT industry, the more primitive the overall picture becomes in my head. It’s as if IT is either serious rocket science or another service that “allows you to * do something else * with just one click.” And beyond the scope of this presentation, there are still activities untouched by new technologies. Go to the same dental - well, where does IT?
What a mistake this is.
Today, the dentist prescribes treatment, and behind his decision may be the work of several hundred engineers around the world. Programmers, mathematicians, technicians, analysts, specialists in ML, managers, factories with 3D printers - all for the sake of sparkling Hollywood smiles.
Why are there so many people, what exactly are they busy with, and how mathematicians and C ++ experts help make teeth even, we talked with Align Tech - a huge international company that massively produces mouthguards for orthodontic treatment.
Align Technology Inc. On My Circle, she received an average rating of 4.5 from her employees, who rated the company above all for interesting tasks, a social package, comfortable conditions and for helping to make the world a better place!
- What kind of thing are you doing?
- Andrey Maksimov : This is an orthodontic treatment. To put it simply, we are committed to moving our teeth to the correct position.
Any person has defects: malocclusion or jagged teeth. To solve the problem, you can put, for example, braces. We came up with a different way to solve this problem - using invisible airliners. This is such a mouth guard, which is made for a specific person. She puts pressure on the necessary teeth, and the teeth move.
We, as a company, provide a solution for the manufacture of cap. At the beginning of treatment, the doctor takes a dental impression or scans with an intraoral 3D scanner, sends the data to us, and we turn them into a 3D model.
“What kind of scanner do you have?”
Sergey Valiev: Imagine an electric toothbrush. It has a head that spins and brushes its teeth. Instead of this head, we have a high-resolution video camera. Based on her testimony, a 3D model is built. The main difficulty is that this must be done accurately and quickly - after all, the patient lies with his mouth open on the chair. Scanning takes about 3-5 minutes.
There are still difficulties with fogging the camera, with splashes, liquids. And now the engineers are engaged in these subtleties.
- How do you get a 3D model from a video? Is this photogrammetry?
- AM : We use a confocal method for obtaining 3D scans, that is, we use a laser and an optical method for obtaining information.
When a fingerprint or scan gets to us, we process it with special algorithms. The program understands where the teeth are, where everything else is. Through our ClinCheck program, the doctor can look at the 3D model of the patient’s teeth and also virtually move them to the correct position. The program also has built-in measuring and diagnostic tools.
- What algorithms do you understand how it should be after treatment?
- AM: There are orthodontic norms by which teeth should be placed. We have a huge base of the correct position of the teeth, and with its help, we suggest this to doctors. In fact, we automate their work.
- Just a comparison of the patient’s teeth with how it should be according to the textbook?
- AM:People have only 32 teeth, and they should stand so that they do not interfere with each other. Accordingly, with the help of algorithms we expose them in a certain way. The doctor checks, makes adjustments, and if he likes everything, he approves the treatment plan, and we begin the process of manufacturing liners.
- How does this process work?
Mikhail Matrosov: For our specially trained employees (technicians), we are creating the Treat program, in which they prepare liners for printing according to data from doctors. Here is a technician who receives data with the patient’s jaw and doctor’s recommendations on how to treat each case. And the concept of “cure” is informal, and the cases are very different.
The program itself is a 3D CAD system. It shows the initial state of the patient’s teeth. Then you can form the desired state after treatment and calculate the intermediate stages - how the patient’s teeth will go from the initial state to the desired one. Finally, the program may indicate that the patient should attach invisible bulges (“attachments”) to certain teeth, which will help the aliner develop the correct strength. Without them, for example, it would be almost impossible to pull some teeth out of the gums.
Each of these steps is performed in semi-automatic mode. The technician sets the necessary settings in accordance with the wishes of the doctor, and the program generates the result. Each step has its own development team.
After the CAD system comes CAM (computer-aided manufacturing). It calculates the complete model of the patient's jaws at each stage (intermediate and final). These models for each stage are printed on a 3D printer. Then a film is stretched onto the printed forms, a segment of this film is drawn along a complex trajectory with a laser, and an aliner is obtained. And for all stages you need a lot of software that is developed inside Align. That's why we need so many programmers.
AM: We make 300 thousand unique liners per day. None of the competitors has reached such a scale, because basically all this is a manual process. And manually huge turns cannot be reached in any way.
- Where are these three hundred thousand liners produced?
- AM: In factories in Mexico and China. They are made of special plastic, which is also being developed in Alain. There is a special chemical formula, since biocompatibility testing was carried out. Material is also know-how, it affects the outcome of treatment.
After this, a ready-made kit is sent to the doctor, he invites the patient and explains how to use them. Aliners wear almost all the time, even at night, and take off only with food. Every two weeks, the cap is replaced with a new one.
Teeth and machine learning
Some dentists are not as well versed in orthodontics as rare specialists. Therefore, we help them solve some simple cases. If the teeth need to be moved slightly, we suggest they use our automatic treatment.
So that the doctor understands whether he can treat some cases or not, we will recognize the situation with a special program, make some diagnostics and issue a conclusion - maybe or not. And for such tasks, we need a lot of specialists - in ML, C ++. Since we have automation, we need backend specialists.
At first, people did the case assessment operation, and artificial intelligence was trained. Now almost 100% of such operations are done by the machine. We tried many approaches. The guys tried to make a 3D model from the photo and find some discrepancies. This did not work very well.
A year and a half ago, the first iteration of the ML model was released. As far as I know, the team used Python and TensorFlow. Evaluation is done in several categories of what the doctor treats. The patient may have crowded teeth, or vice versa, when they diverge to the sides. These are different problems with teeth and different models work for them. They are the most common and we started with them, then moved on to more private cases.
In the next release, we will roll out models for all possible types of problems with teeth. For some time we will track all the problematic cases and parse the errors. There will be a reserve from the manual assessment team for this.
The complete model training process took approximately two years.
Machine learning is also used to work with photos. We are trying to show the person how his smile will look after treatment. To do this, we take a photograph of the patient, render a 3D model of his teeth, and then the program tries, in a way close to reality, to embed it in the photograph so that the person sees how his smile will look beautiful.
How Align appeared in Russia
- AM: About 15 years ago. People from Moscow studied in California, and while studying, they got a job at the Align office. In those days, it was a small company. When they finished their studies, they returned to Moscow, but contractual relations with them remained. They just were very good programmers. And to make it easier for them to work, a small office was opened in Moscow. Then it grew to a very large scale. Now there are more than 400 people.
In Novosibirsk, the office opened in the same way as in Moscow. A man who proved himself very well came from there and decided to return to his city. He offered to work remotely, but he was assigned to create a small office. There are now about forty people.
SV:Interestingly, a year ago in Moscow there were about 200 people. We almost doubled in a year.
- How are your people distributed among all these projects?
- AM: We have a team of engineers that deals with the backend. There is a team that is involved in the ClinCheck program for doctors. The largest team is engaged in software for technicians, which is used only internally. There are separate QA and DevOps teams. The iTero team makes scanner software.
- How independent are the teams technically?
- AM:Business tasks for the teams come from marketing, but technical decisions are made independently here in Moscow. They do not need special permissions from headquarters. If we change architecture between systems, we should at least talk about it and get agreement. But at the functional level, we have complete independence.
Andrey Zaitsev: We have a process called Architecture review board. Even if we are free enough to choose, we must justify it to leading architects.
For example, we now have the main development language - Java. But the team expressed great interest in Kotlin. One of our developers for six months prepared presentations with a justification, taking into account the risks of hiring, risks of data leakage, problems in the language. He made a presentation at an architecture council, we got an upgrade, and the team got an additional development language. Now for new micro services we use Kotlin instead of Java. That is, we are free, but everything needs to be justified. You can’t just suddenly switch to some Haskell.
- And how is communication with other offices built?
- AM: There are no difficulties with the interaction. We constantly travel to the R&D office in Raleigh in North Carolina, USA, and to our headquarters in San Jose.
- AZ:We have six SCRUM teams in the backend. One is located in the Israeli office in Tel Aviv, the other in Raleigh, the rest in Moscow. We synchronize twice a week, team leaders discuss the current process, upcoming releases, interactions between teams, new technical solutions, changes in common modules. And so - standard corporate communication. We have all Microsoft teams, if necessary, you can recruit any colleague and talk to him.
There used to be a problem that the office in San Jose is in the opposite time zone from Moscow, and when they come to work, we just leave. Therefore, meetings usually took place late in the evening. With an office in Raleigh easier, with them rallies begin around four o'clock in the evening in Moscow.
- AM:Since my team is developing a program for doctors, we should show demos to doctors who work in our company at the end of sprints. They sit in San Jose, USA, so sometimes you have to start demonstrations no earlier than seven in the evening.
What technologies make teeth even
- Tell me, who is doing what using what?
- AM: ClinCheck, which my team is developing, exists in two forms. The first is a desktop application. It is made in C ++ and Qt for the user interface. The desktop was written a very long time ago. The problem with him is this: doctors are not IT people at all. Despite the fact that they are cool specialists in the field of orthodontics, it is very difficult for them to keep the computer in good condition. And when we release the update, a lot of technical difficulties begin.
The second problem is that half of orthodontists use Macs, and our desktop is only for Windows. If the doctor wants to use the program, he has to install a virtual machine. This is inconvenient - they do not cope well with a computer, let alone manage a virtual machine in general.
Therefore, we translate the application on the web so that it works everywhere. True in terms of functionality, it has not yet caught up with the desktop version. As soon as it catches up, we will collapse the desktop.
In development we use TypeScript and ReactJS. The script was chosen primarily because of the possibility of static type checking. Interestingly, some of the front-end devices switched from C ++, so there was a desire to continue to use static typing.
- But do you write other services in JavaScript?
- AM: Yes, the team that makes the commercial web portal writes it in JS and TypeScript.
- When you decided to take TypeScript, you were not told that since the company already uses JS, would it be better for you to take it?
- AM:Naturally, we had to defend the choice, but we explained that TypeScript has several advantages. Everything here was exactly the same as in the case of Kotlin.
- AZ: Andrey’s team does the front, what the doctors see. My team does a backend for this so that there is where to store and process the data. We started making our system in 2014. At that time, the company had several large enterprise-level systems, but they were slowly developing, they were monolithic, with very long release cycles, I had to test a lot, and not every build was successful.
Just then, the microservice approach became very popular, and we tried to implement it with our team. That is, we develop small applications with a clearly defined goal, a clear area of responsibility.
Our main stack is Java. We use Spring as a framework and many things that are under its umbrella - security, working with the database, various cloud services to ensure reliability, error handling. We know him well, we like everything and are not going to change him yet. We use it as the core of any of our services.
Now we have about 20-25 services. They are divided between six teams, and in the area of responsibility of each, 3-5 microservices are obtained. We do not spend resources to rewrite Java on Kotlin, but we write all the new services and tests in Kotlin. Now the ratio is about 95/5. So far, only three services are written in Kotlin, because we began to use it actively only from the end of last year.
- How does the team perceive the transition? Everybody wants?
- AZ:In general, they are perceived positively, the guys are happy to understand. There are, let’s say, several Kotlin champions - those who really wrote a lot, and they help the rest with a code review.
I would like to develop an understanding of exactly how the API on Kotlin should work, so that it is not just code rewritten automatically. And the guys are trying to develop a certain archetype, which will then be used everywhere.
In general, we try to replicate good decisions. Since we have two dozen services, certain things, such as security, working with the database, working with cloud providers, they are repeated everywhere, so we have a common code base. There are different modules that rummage between the components, which allows you to lift an empty microservice without business functionality in literally a day. And there is everything you need to work. It helps a lot to move forward.
At the base level, we usually take Postgress or some kind of noSQL. There is some Python for bdd tests. For various data upload requests, we write scripts on it.
All services are deployed in the cloud. The main thing is Amazon. We take the application, pack it in the Docker container, and then deploy it within one of the orchestrators. A few years ago, we chose Rancher and now use it.
- When you first arrived, you did not encounter the fact that the project has a large and complex legacy. Still, this is a product that began in the late 90s.
- AZ: We approached the fight against big legacy monsters like this: at first we wrote some proxy that wraps in microservices with a REST interface, and only then we tried to break it inside and refactor. That is, I did not have to sit for weeks to figure out the code base for two hundred thousand lines.
We write many things from scratch, we rewrite some. On new projects, we try to maintain the quality of the code. The team is already the fifth year, and it seems to me that we are doing pretty well so far.
Hiring mathematicians and C ++ experts
- Do you need to understand orthodontics?
- AM: Not at all. It is unrealistic to find people who have such a background. In the work itself, one has to study one way or another. Different teams need a different understanding. The ClinCheck team is more because we are talking with doctors, and we need to at least understand their words.
But in interviews, we never ask about this - we are looking for people who are primarily versed in programming.
“What will you look at to understand this?”
- AM: At the first stage, we look at the resume, evaluate the experience. Then we organize a telephone interview, which lasts about 30 minutes. We ask simple questions about technology, with what and how it worked. And if a person has shown himself well, we invite him to the office.
There we usually give a programming task. It is not academic, you do not need to write all sorts of sorting algorithms. We give a practical task, for example, how to implement an application such as Twitter. A person writes a code for 20-30 minutes and then we ask questions on this code.
The formulation of the problem contains several pitfalls that a person should try to get around. If he is experienced, he immediately sees these problems and either solves them in the code, or tells us about it. If he doesn’t notice, we tell him and also see how he will decide.
In general, the interview lasts about two hours. And the entire hiring from and to takes about two weeks.
MM:For hiring internal services, we primarily look at C ++ and math. Depending on the team, there is an offset either in one direction or in the other. The team that builds the model of the distribution of forces on the aliner is, of course, primarily mathematics.
The team of the 3D platform in which I work does not deal with product issues (there are a lot of them), but supports the system engine, makes C ++ libraries. There, first of all, C ++ and knowledge of algorithms.
- Perhaps it is difficult to look for people in such a team?
Yes and no. It is difficult because you need a good knowledge of the pros, an understanding of how software and hardware work. But a little easier, because at least we don’t need mathematics so much. If a person remembers lingering a little, this is more than enough - just not to fall into a stupor if he sees that the vector is multiplied by a matrix.
We have a similar hiring process: selecting a resume, phoning for half an hour. We ask by phone about data structures and how they differ from each other. The simplest algorithms about the complexity of sorting, how is memory management, what is a virtual function. In general, basic things.
- When you are looking for a person with knowledge of C ++ and mathematics, his soft skills will be very important?
Usually, if a person has good C ++ and mathematics, then his lack of software skills will most likely not be that he is in conflict and quarrels with the team, but in closeness. For example, a powerful introvert who loves to delve into tasks and does not particularly like to talk with people.
There are rarely conflicts with such. The problem that can happen is that you want him to tell you how it works, and he will only say a few words, in complete confidence that the rest is obvious. But if you continue to ask, in the end you can fetch everything you need. And even if he doesn’t manage to explain something well, he can certainly write down, attach comments and explanations in the document.
- Have you tried using liners yourself?
Used. The company completely compensates us for the production of liners. But, unfortunately, the doctor has to pay for the work. In Russia, this is half the cost. In America, the work of a doctor is a big part. 5-6 thousand dollars all treatment.
- It happens that the developers do not want to go to you, simply because "this is some kind of dentistry, not IT"?
SV: This is the most common question in the interview - "where does IT in general". And when you explain that we are not a dental company, but simply make a real product - not some abstract task trackers - that are used by real doctors, then people are immediately involved.