# Deep Learning-Based Algorithms for Real-Time Lung Ultrasound Assisted Diagnosis
## 3 Results
### Real-Time Implementation Results  
As already mentioned, the implemented software (version 1.0) is capable of processing and displaying in real-time the pleural line, B-lines, consolidations, and A-lines. The algorithm can calculate and obtain the percentage of pleura affected by B-lines, which could be useful to physicians when classifying and determining the severity of a patient's condition.  
The implementation proposed in this study achieves a processing rate of up to 20 predictions and image update per second using an octa-core i5 CPU processor and a NVIDIA GeForce RTX 2060 GPU, which is a medium-range hardware set-up. This figure coincides with the framerate given by the ultrasound scanner, so we can state that the solution operates in strict real-time. In terms of computational cost in the different processes, the main process takes about 10 ms, which gives a fluid and latency-free feeling during the scan, while the real-time computation process takes about 50 ms of which 20-25 ms is for model inference on the GPU. It is worth mentioning that, in the current implementation, the final image refresh rate depends on the number of artifacts detected, due to the respective post-processing and painting algorithms that are not yet optimized. Therefore, the effective frame rate obtained was between 17 and 20 FPS, which should be improved by parallelizing the last stages of the algorithm.  
Regarding prediction capability at the video level, the results given by the model are compared with the opinion of an expert physician. Two different calculations are performed: first, its performance with the whole dataset is assessed (Table 5), and second, a specific comparison is made for the set of patients excluded from training (Table 6). With these results, it is worth noting that the number of false positives and false negatives are balanced in the case of detection of consolidations and B-lines, which is positive since it is a sign that there is no bias in the training. Additionally, to ensure that the model performs well for normal cases, specific metrics such as accuracy, false positives, and false negatives  
Figure 15: Results comparative with different image gain: (**a**) healthy lung; (**b**) pathological lung; (**c**) grave lung.  
were calculated for videos showing only A-lines or no artifacts at all. These metrics are included in Tables 5 and 6 under the \"Normal lung\" column. The results demonstrate that the model achieves balanced performance, even for healthy lungs, despite the dataset focusing more on pathological findings.  
It can be observed that the accuracy of the proposed solution at the video level is quite high, and it behaves stably even with patients out of training. In the case of the detection of A lines, the results are notably worse than for consolidations and B-Lines, and this because, in the labelling process carried out by the physician in [24], labelling the A lines was not mandatory, given that they are indicative of healthy lungs. Therefore, the dataset labelling contains false negatives in those videos where the A-Line is present, but it was not marked by the physician. This limitation might partially explain the lower performance in detecting A-lines compared to other artifacts. However, the inclusion of normal lung metrics demonstrates that the solution remains robust and accurate when distinguishing healthy from pathological cases. This is a limitation of this study, but it does not imply that the performance of the solution is nevertheless promising.  
Figure 16 shows several examples of the screen of the