## 2 Materials and Methods
### System Architecture
#### 2.3.4 Diagnosis Module  
The diagnostic module is a key element of the proposed system architecture and employs a feed-forward neural network (FNN) to categorize lung lesions as malignant or benign based on vascularization metrics derived from Doppler ultrasound images. This method utilizes machine learning to improve diagnostic precision, efficiency, and impartiality in clinical practice.  
The FNN architecture consists of the subsequent layers:  
* Input layer: This layer receives three essential vascularization parameters: (1) area of blood vessels within the region of interest (ROI); (2) tortuosity index of the vascular structures; and (3) distribution of vessel orientation;
* Hidden layers: These were incorporated to identify intricate patterns and correlations among the input parameters. The number of layers were refined for the dataset to guarantee computational efficiency while enhancing diagnostic precision;
* Output layer: This generates a classification result as a probability score reflecting the possibility of the lesion becoming malignant.  
Also, to prevent overfitting, L2 regularization (\(\lambda\) = 0.01) was applied to the network weights, and dropout layers with a dropout rate of 0.3 were introduced between hidden layers. These techniques improved model generalization and reduced the risk of overfitting during training. The data used consist of 565 Doppler mode ultrasound (US) images that are carefully annotated. Due to the limited number of US images, in order to improve the robustness of the proposed system, several data augmentation techniques (image transformations) were used on the train dataset. The dataset was extended by scaling rotations and applying filters on initial images. For each initial image, three rotation procedures and one scaling procedure were applied. Also, for each initial image, we applied six filters. After applying augmentation, the dataset had 3390 images. The dataset was split into a train dataset (60%), validation dataset (20%), and test dataset (20%). Maintaining a strict 60%-20%-20% train-validation-test dataset split ensured that the validation and test sets remained independent, preventing overfitting and preserving model generalization. Additionally, k-fold cross-validation would have further reduced the number of unique patient cases per fold, potentially affecting classification reliability. Instead, a single, well-stratified split was used, ensuring that benign and malignant cases were adequately represented across all three subsets while maintaining computational efficiency.  
Figure 3 presents the augmented data obtained using several filters.  
The implementation was performed in Matlab, and the training was performed on a personal computer with the following characteristics: (1) processor (CPU): 13 th gen Intel(R) Core(TM) i9-13900H, 2600 Mhz, 14 Core(s), 20 logical processor(s); (2) graphics processing unit (GPU): NVIDIA GeForce RTX 3050, 4 GB VRAM (ASUS, Taipei, Taiwan), used for parallel computations; (3) RAM: 32 GB DDR4 (Micron, Boise, ID, USA).  
Figure 3: Filters applied on the initial image: (**a**) initial Doppler ultrasound image; (**b**) Arctic filter applied on the initial image; (**c**) Burlesque filter; (**d**) Zeke filter.  
The Levenberg-Marquardt algorithm was used at first for training, achieving rapid convergence and high accuracy. In addition to the Levenberg-Marquardt (LM) algorithm, we evaluated other optimization methods, including Adam, stochastic gradient descent (SGD), and Bayesian regularization. While Adam and SGD achieved comparable accuracy (-97%), LM demonstrated superior classification performance (98%) with faster convergence. Given the network size and dataset constraints, LM was selected as the most effective training algorithm for this study.