ADVANCED BLADDER ANALYSIS USING ULTRASONIC AND ELECTRICAL IMPEDANCE TOMOGRAPHY WITH MACHINE LEARNING ALGORITHMS ZAAWANSOWANA ANALIZA PĘCHERZA MOCZOWEGO Z WYKORZYSTANIEM ULTRADŹWIĘKOWEJ I ELEKTRYCZNEJ TOMOGRAFII IMPEDANCYJNEJ Z ALGORYTMAMI UCZENIA MASZYNOWEGO

Purpose: The primary purpose of the study is to reconstruct the bladder based on the tomographic measurements obtained. Depending on the type of tomography used, two approaches are presented. Methods: In the first presented case, the measurements were collected using ultrasonic tomography, while in the second one, they were gathered with electrical impedance tomography. Deterministic methods and machine learning algorithms, such as Elastic Net, Least Angle Regression


Introduction
The urinary bladder is a vital organ in the human urinary system.It allows the storage of filtered urine and keeps it under control.The empty bladder has a pyramidal shape and fits into the pelvis.It becomes more spherical and moves into the abdominal cavity as it fills.It consists mainly of smooth muscle and connective tissue, which allows it to contract and expand under the pressure of accumulated urine.The bladder can hold from 400 to 700 ml of liquid.The kidneys produce urine and then flow down the ureters to the bladder, where it is stored.Once complete, the bladder is responsible for actively removing accumulated urine.For men, the bladder is higher than in women, in the pelvis, at the front of the rectum.The bottom of the bladder rests on the prostate gland.For women, the bladder is located in the pelvis, with the uterus located between it and the anus.
In medicine, tomographic imaging of the urinary bladder is essential for diagnosing, planning treatment, and monitoring the condition of this vital organ (Eimen et al., 2024;Peng et al., 2023).Accurate imaging of the urinary bladder's structure allows for detecting possible changes such as tumors, stones, or polyps.This will enable diseases to be diagnosed earlier, and appropriate treatment can be undertaken.
It is essential to monitor the organ's condition and detect possible abnormalities.Before bladder-related surgeries, such as stone removal or tumor resection, the tomographic image allows for precise procedure planning.The capacity, shape, and changes in the urinary bladder can be assessed.The doctor can see where exactly the problem is and how it relates to other anatomical structures.After a procedure or therapy, the image can be used to evaluate the effectiveness of treatment (Benfante et al., 2024;Kalinkina et al., 2024).

Research Methodology
Ultrasound tomography (UST), or ultrasonography, is a non-invasive imaging test using high-frequency sound waves (Dziadosz et al., 2024).UST is used in medicine to assess the internal structures of the patient's body and for examining abdominal organs (e.g., liver, kidneys, pancreas), thyroid gland, cardiovascular system, genitals, muscles, and joints (Kłosowski et al., 2023;Soleimani et al., 2024).During an ultrasound examination, a unique head emits sound waves reflected from internal tissues.An image of anatomical structures can be obtained based on the time it takes for the waves to return to the head.UST tomography is a safe method; it does not use ionizing radiation (unlike computed tomography or X-ray).It can be used for children, pregnant women, and the elderly.However, appropriate preparation may be required.For example, for an abdominal examination, the patient should be fasting.
Electrical impedance tomography (EIT) is a non-invasive medical imaging method that allows visualization of spatial distributions of conductivity and permittivity in the examined volume.EIT uses impedance measurement between surface electrodes surrounding the object.Different biological tissues are characterized by various values of electrical properties, which enable the reconstruction of tomographic images.EIT can also be used in many areas of medicine, such as diagnosing heart disease, monitoring the condition of soft tissues, or monitoring lung function.The respiratory cycle has a strong influence on conductance.During inspiration, lung tissue becomes more conductive due to less insulating air in the alveoli.EIT enables rapid visualization of regional lung ventilation, which is helpful in intensive care.It is also a safe method; it does not use ionizing radiation.It can treat children, pregnant women, and the elderly.

Bladder reconstruction using ultrasound tomography
The research concerned a urinary tract phantom using ultrasonic tomography.Figure 1 presents a medical silicone phantom and the electrode placement points.For the reflection method, electrodes were applied to each point in turn, i.e., signal measurement was performed using ultrasonic transducers with different frequencies.The circumference of the phantom at the places where the electrodes are applied was 38 cm.The number of electrodes was 19.A mesh was made for the cross-section of the phantom at the electrode locations (Figure 2).Additionally, the electrodes were marked.There were 548 nodes and 999 finite elements.
M. DZIADOSZ, P. BEDNARCZUK, R. PIETRZYK, M. SUTRYK  Bladder reconstruction was performed in two ways.For each pair of TX/RX electrodes, the reflection time of the second wave was determined, and then the path (the sum of the distances between TX and the bladder wall and RX and the bladder wall) of the signal was calculated.After determining the distance traveled, ellipse arcs were marked on the grid, with foci located in the places of the TX and RX electrodes.For example, for the speed of sound in medical silicone 540 m/s and the signal presented in Figure 3, the distance is equal to:  For each pair of electrodes, the arcs were placed on the grid (19 pieces), which resulted in the reconstruction of the bladder walls (Figure 6).

Figure 5. Reconstruction of the bladder edge
To reconstruct the bladder area, first, for each pair of TX/RX electrodes, it is essential to determine the area consisting of finite elements (Tolle and Marheineke, 2024;Zhang et al., 2024) for which the signal transit time from the TX electrode to the center of mass of the finite element and from the center of mass to RX exceeds the time until the start of the second wave (or the sum of the distances from electrode TX to the center of mass of the finite element and from the center of mass to RX exceeds the distance traveled by the signal in time to the beginning of the second wave reflection).In the next step, the standard part of the areas for each pair of electrodes was determined, thus obtaining a bladder reconstruction (Figure 7).

Bladder reconstruction using electrical impedance tomography and machine learning
This chapter presents three machine learning algorithms (Elastic Net, Least Angle Regression, and a Neural Network with one hidden layer) used to obtain bladder reconstruction (Baran et al., 2023;Kulisz et al., 2024).Various sample size variants were considered to train the models, of which ¾ of the sample went to the training set and ¼ of the sample to the test set.An example comparison of the reconstruction and the real object is presented in each model case.The Mean Squared Error (MSE) was also calculated for each machine learning algorithm.
Elastic Net combines two popular variants of linear regression with regularization: ridge and lasso.It allows the use of both methods at the same time.The ridge variant uses L2 penalties to limit the values of the regression coefficients.It helps reduce the magnitude of the coefficients, which can prevent model overfitting.It is used when there are multiple collinear relationships between variables.On the other hand, the lasso type uses L1 penalties to reset some coefficients to zero.It helps in selecting important variables, eliminating those with less impact.Elastic Net combines both the L2 and L1 penalties.It allows for controlling the balance between L1 and L2 regularization (Allerbo et al., 2023;Chamlal et al., 2024;Merdas, 2024).The relationship between the number of cases in the training set and the quality of the obtained bladder reconstructions (measured as MSE) using the Elastic Net method is presented in Table 1.At the same time, Figure 8 compares the rebuilding and the real object.Least Angle Regression (LARS) is an algorithm used in statistics to fit linear regression models to high-dimensional data.It was developed by Bradley Efron, Trevor Hastie, Iain Johnstone, and Robert Tibshirani.It determines the solution path depending on the regularization parameter, showing how regularization affects the coefficients in the model.The algorithm iteratively selects the variables that have the most significant impact on the response and then targets those variables, minimizing the regression error.It resists multicollinearity (Allu and Padmanabhuni, 2023;An et al., 2023;Li et al., 2023).

Table 1. Relationship between the number of training cases and the quality of the bladder reconstructions -Elastic Net
Table 2 presents the relationship between the number of cases in the training set and the quality of the obtained bladder reconstructions (measured as MSE) using the Least Angle Regression method.At the same time, Figure 9 compares the rebuilding to the real object.A neural network with one hidden layer consists of three main layers: • an input layer that receives input data, e.g., image features, text or numbers, • a hidden layer that consists of neurons that process input data.Each neuron computes a weighted sum of inputs and passes it through an activation function, • an output layer that generates an output, such as image classification, weather forecast, or numerical value.
Neurons in the hidden and output layers use activation functions that introduce non-linearity into the model, which allows for more complex data transformations (Karakoyun, 2024;Xiao et al., 2024).The connection weights between neurons are initialized randomly.The network is trained on a training set, where the error is calculated for each example, and the weights are updated through backpropagation.The goal is to minimize errors in the training set and to be able to generalize to new data.It performs well in classification and regression problems (Bilokon, 2023;Hanif, 2024;Pan, 2024).The relationship between the number of cases in the training set and the quality of the obtained bladder reconstructions (measured as MSE) using the Neural Network method is presented in Table 3.At the same time, Figure 10 compares the rebuilding and the real object.

Conclusions
The study emphasizes the potential of non-invasive bladder detection and analysis techniques.Non-invasive imaging methods are the foundation of the success of modern medicine.These techniques do not require the insertion of instruments or penetration of the patient's body.This means there is no risk of tissue damage or infection.Patients also do not feel pain during non-invasive tests.This is important, especially in the diagnosis of children and people sensitive to pain.Additionally, these methods are relatively quick and convenient.Patients do not have to stay in hospital or undergo a long convalescence process.Non-invasive imaging techniques can be used repeatedly without risk to the patient.However, it is worth remembering that each method has limitations and is not always suitable in every case.Depending on the patient's situation, the doctor will always select the most appropriate diagnostic method.Two approaches were presented -one based on ultrasound tomography and the second on electrical impedance tomography.Deterministic methods and machine learning algorithms were used to obtain the bladder reconstruction, delivering promising results.
Further work will focus on enhancing and optimizing the performance of the discussed methods.The resulting bladder reconstructions are already satisfying.However, improving their quality and shortening the time needed to obtain them is still possible.

Figure 4
Figure 4 provides an example of such an arc on the grid.

Figure 4 .
Figure 4. Determining the arc of an ellipse

Figure 6 .
Figure 6.Determining the area of finite elements for which the sum of the distances of the component centers to the TX and RX electrodes exceeds the signal path until the second wave is reflected

Figure 7 .
Figure 7. Reconstruction of the bladder area

Figure 8 .
Figure 8.Comparison of the reconstruction (the upper panel) and the actual object (the lower panel) -Elastic Net

Figure 9 .
Figure 9.Comparison of the reconstruction (the upper panel) and the actual object (the lower panel) -LARS

Figure 10 .
Figure 10.Comparison of the reconstruction (the upper panel) and the actual object (the lower panel) -Neural Network

Table 2 .
Relationship between the number of training cases and the quality of the bladder reconstructions -LARS

Table 3 .
Relationship between the number of training cases and the quality of the bladder reconstructions -Network