ADVANCED IMAGE ANALYSIS FOR MEDICAL DIAGNOSTICS: A SYSTEM FOR SEGMENTATION AND CLASSIFICATION USING LEVEL SET METHODS AND AI ALGORITHMS

This work aims to implement and utilize an advanced computer system for image analysis and processing through artificial intelligence. The system will evaluate images from multiple sources. As a result, a comprehensive e-Medicus system will be developed to capture and analyze X-ray data and classify cancer cells. This innovative tool, with its unique features tailored for medical facilities, will assist them in capturing and analyzing X-ray images and CT scan results. The e-Medicus system offers several benefits for medical facilities, including efficient automation of photo analysis, tracking changes in a patient’s condition over time, and facilitating the identification of medical changes and data classification. A multimedia presentation of the change process will use the contour set function, allowing for topological changes in solution properties. The system integrates novel procedures and algorithms from theoretical computer science and numerical mathematics, leveraging neural networks, genetic algorithms, semantic networks, image ontology, rough set theory, contour set methods, and hybrid algorithms. These developed algorithms enhance methods and concepts in image segmentation, gathering, transmitting, storing, extracting, and effectively presenting information.


Introduction
There is significant market demand for software supporting the processing of medical records (including radiological images).Considering societies' tendency to age in developed countries, there is an increase in the number of medical procedures performed -including diagnostic procedures (Argenziano et al., 2000;Balla-Arabe et al., 2013;Braun et al., 2005).Due to the significant costs of qualified medical staff, it is advisable to limit the time needed to analyze an individual medical document while maintaining the current quality of the analysis.The answer to this burning problem of modern medicine is to support the analytical process, previously often carried out manually, using modern IT systems.No solutions enable advanced segmentation and analysis of X-ray images in offices, clinics, and small hospitals.In Poland, comparing X-ray images manually relies on the doctor's knowledge.Only in the United States and large radiology centers are advanced IT systems that enable the management of imaging diagnostics (Gdula et al., 2015).Disadvantages of existing solutions: (1) Very high costs of system implementation and management; (2) Use of CAD methodology in the process of segmentation of X-ray images -low quality of segmentation, segmentation relying mainly on the knowledge of the radiologist; (3) Solutions exclusively dedicated to a specific client, no IT system supporting X-ray diagnostics.
The application goal of the project was to build a prototype of an intelligent IT system that processes and analyzes images using artificial intelligence.The innovative IT system's functionality involves analyzing images from various sources.The project's final result is a prototype of the e-Medicus system for recording and analyzing data from X-ray images and classifying cancer cells.Thanks to its implementation, the company will offer new innovative software, provided in the form of license sales, implementations, and the form of SaaS, addressed to healthcare units, such as hospital imaging diagnostic laboratory units, radiological diagnostic centers, doctor's offices (including dentists') and clinics.
The prototype is an IT system supporting the activities of healthcare units performing radiological examinations.It records and analyzes X-ray images and computed tomography examination results.Analyzing radiological images involves their processing, image identification, and segmentation.Thanks to such analysis, it is possible to track changes in the patient's condition over time (Johr, 2002;Li et al., 2008;Mumford et al., 1989;Osher et al., 2003;Osher et al., 1988).
The task of the e-Medicus system is to register and analyze medical images in the form of numerical functions.This allows for identifying medical changes and the appropriate classification of collections.The multimedia representation of the change process is made using the contour sets function, which allows for a topological shift in the properties of the solution.Additionally, the designed system uses an ontology model for image and data processing and developing data mining models from database systems.The application uses various algorithms (computational intelligence, hybrid) combining the methods' properties.The e-Medicus system is primarily used to analyze and segment X-ray images.The main goal of this functionality is to use algorithms for image segmentation by separating individual objects and their fragments.The segmentation must represent the intended level of detail.Separating image fragments with standard features allows us to more precisely define the boundaries between individual tissues and detect anomalies within them.The process of computer image analysis begins at the pixel level.The image is represented as a two-dimensional array of color points.A single element of the array corresponds to a single pixel.The table only provides information about the location and color of individual image points but does not contain information specifying which pixels constitute particular objects.You must go from the pixel to the object level to analyze an image.The algorithms use the contour sets method and its variational modification, the Mumford-Shah model, and computational intelligence algorithms.
The e-Medicus system can also be a tool for analyzing and classifying cancer cells.Many methods are used to treat cancer.They depend on the type of tumor and how quickly it spreads.The formation of cancer cells is a continuous process.During this period, a healthy cell transforms into a cancer cell.It is not known when this process begins and how long it lasts.Therefore, it is essential to look for solutions that enable cancer to be detected as early as possible.The proposed system allows for the analysis of cells in terms of many parameters.One of them is the morphometric features of the cell.They describe properties such as cell size, shape, and intensity.The choice of parameters depends on the type of genetic material being tested.The software implements optimization tools that allow you to select the best values of these parameters.Contour sets and computational intelligence algorithms were used to analyze the results.Models generated based on collected image analyses may prove helpful in automating the process of early cancer diagnosis (Rymarczyk, 2012;Rymarczyk et al., 2013;Rymarczyk et al., 2009).

Architecture of the e-Medicus System
The e-Medicus system serves as a tool for analyzing and classifying cancer cells.Many methods are used to treat cancer.They depend on the type of tumor and how quickly it spreads.The formation of cancer cells is a continuous process.During this period, a healthy cell transforms into a cancer cell.It is not known when this process begins and how long it lasts.Therefore, it is essential to look for solutions that enable cancer to be detected as early as possible.The proposed system will allow the analysis of cells in terms of many parameters.One of them is the morphometric features of the cell.They describe properties such as cell size, shape, and intensity.The choice of parameters depends on the type of genetic material being tested.The software will implement optimization tools that enable the selection of the best values for these parameters.The images will be sent to a computer, and then, as a result of image analysis, cells will be extracted as a result of scanning.Contour set and computational intelligence algorithms will be used to analyze the results.Models generated based on collected image analyses may prove helpful in automating the process of early cancer diagnosis (Fig. 1).The analytical work will aim to develop algorithms that will allow the selection of cancer cells based on appropriately prepared preparations.

DICOM standard support
A specific feature of the DICOM standard is information organization into data sets.The file resulting from diagnostic imaging contains the patient ID, which prevents this information from being accidentally separated.A header with a length depending on the amount of accompanying information is an inherent element of the DICOM format file and contains other information about the image.The DICOM header contains a 128-byte preamble (usually zero-padded) ending with ASCII codes of the DICM letters, followed by the actual header information organized into data groups (Fig. 2).

Visualization of the change process
The contour set method enables topological changes in the shapes of figures and allows for the optimization of dimensions and forms of objects.The method's main advantage is the ability to perform numerical calculations related to curves or planes in the Cartesian system without parameterizing them.A particular area with a movable edge is considered when considering the method of contour sets.This edge moves at a speed determined in the following steps, which may depend on the position, time, shape of the edge, and external conditions.The idea of contour sets is to define a function representing a moving edge.The active contour model in the Mumford-Shah model was based on two-phase segmentation and the contour set function.Fragmented continuous segmentation enables using a multiphase version of the contour set method (for more than two segments).Artificial neural networks were aimed at obtaining the expected solution in a very short time, practically.This method involves selecting an appropriate neural network and collecting data for its training.ANNs behave like approximation systems and have a particular ability to generalize the information they are taught.Samples are prepared for training the network, covering the entire tested surface.The ability to locate an object in the place used in the network training process measures the network's ability to remember training data.The measure of the network's generalization ability is the ability to recognize the location of an object that the network has not seen before.Particular attention is paid here to ensure that the neural network does not adapt too much to the training samples.It could then lose its generalization properties, increasing image reconstruction errors.On the other hand, the network structure cannot be used poorly so that the approximation is not too superficial and, therefore, inaccurate (the phenomenon of undertraining the network).
Genetic algorithms are programs that imitate the natural phenomenon of evolution in how they solve problems.Large populations have long carried out natural selection through reproduction and mutation.Following in their footsteps, programs using genetic algorithms create a population of possible solutions to a given problem.Then, by carrying out the processes of random selection and variation several times, subsequent program generations are created, each characterized by an increase in the quality of the solution.Genetic algorithms control the evolution of solutions using genetic processes.
Fuzzy systems include techniques and methods for imaging imprecise, undefined, or non-specific information.They allow us to describe ambiguous phenomena that cannot be captured by classical theory and two-valued logic.They are characterized by knowledge being processed in symbolic form and recorded in the form of fuzzy rules.Fuzzy systems are used where we do not have sufficient knowledge about the mathematical model governing a given phenomenon, and reproducing this model becomes unprofitable or even impossible.
Approximate sets are sets defined on a discretely divided space.Space is discretized by defining an elementary set, the size of which depends on the degree of space approximation.Rough sets have an attractive property in that the elements in the area of the elementary set are indistinguishable from each other, and we can only say that they have the values of all features the same as the entire elementary set.Due to its properties, the contour sets method is used in image segmentation through the ability to isolate individual objects and their fragments.The segmentation must represent the intended level of detail.Separating image fragments with standard features would allow us to precisely define the boundaries between individual tissues and detect anomalies within them.The process of computer image analysis begins at the pixel level.The image is represented as a two-dimensional color array.A single element of the array corresponds to a single pixel.The table only provides information about the location and color of individual image points but does not contain information specifying which pixels constitute particular objects.To analyze an image, you must go from the pixel to the object level.The contour set method can segment image objects obtained using any techniques and extract the shapes sought in these images.
A multimedia presentation of the change process made using the contour sets function allows for a topological change in the properties of the solution (e.g., if two photos were taken at a certain time interval, the system would show the process of simulating the change that took place between the first and second images) (Fig. 3).It is possible to select an area and simultaneously determine its location.There are three options for resolving the area with a polygon, a rectangle, or an ellipse (Fig. 4).The area can be marked in one image or several images simultaneously.The built-in DICOM file viewer lets the user easily, conveniently, and quickly view the collected DICOM files.At the same time, the browser displays data saved in the file, such as personal data, type of measuring equipment, radiation dose, etc. Image animation allows you to play a sequence of loaded images in the form of a movie, and an additional module enables 3D imaging of a series of photographs.The user can decide whether the surface or selected cross-sections will be visualized.Additionally, the user can determine the quality of the created three-dimensional image by initially specifying the size of the photos (height, width).The user also indicates the planes he wants to visualize (Fig. 5).

Prototype of the data analysis and presentation module
Knowledge was acquired about hybrid methods used in optimization algorithms.These methods were assessed in terms of the usefulness of their individual properties in constructing numerical algorithms.
Hybrid algorithms combine features of different methods.Each method has its limitations, but by combining several methods, we can use their most vital aspects.Intelligent hybrid systems try to integrate different artificial intelligence techniques.They were created based on the statement that these methods complement each other; the advantages of the other compensate for the disadvantages of one.
Algorithms enable image segmentation using computational intelligence methods.The user can use one of the available algorithms, such as genetic algae, K-means, neural networks, fuzzy sets, or rough sets (Fig. 6).

Figure 6. This is an example of the segmentation result obtained using fuzzy sets for the image of pathological dermatological lesions
A set of functions that segment the image using the level set method -the user can define the parameters of the algorithm call (e.g., number of iterations) as well as the type of algorithm used.Available methods using contour set methods: Contour set method, Variational method, Mumford-Shah functional, Variational method with M-S functional, Variational method with L-M functional.For the contour set method to work correctly, selecting the initial contour is necessary.The user can designate many measurement contours (Fig. 7).

Agent model
Semantic networks are used to analyze data resources, formulate queries in natural languages, and generate additional knowledge through logical inference.An advanced information and analytical system that combines applications and technologies enables the collection, integration, collection, selection, analysis, and clear presentation of information and business knowledge from various sources for the needs of a specific field of the company's business activity.Obtaining unstructured information allows the organization's knowledge to be enriched with information about its environment.This creates the opportunity to make better business decisions.Improving the processes of retrieving information from the Internet involves using automatic text analysis techniques, semantic agent technologies, and semantic networks.Semantic networks will enable automatic access to information based on semantic metadata, enabling machines to process and understand information (using AI techniques).A knowledge network will be created and enriched with machines' ability to process this information intelligently.Various automated services can help users perform complex tasks by accessing information machines can understand.In the final phase, this process will create a knowledge system that will be used to analyze data and form business processes.
Ontologies have received growing interest in the computing community, and their benefits have been recognized in many fields.In the project, the role of ontology is to facilitate access to information from heterogeneous sources of data and knowledge by supporting information synthesis processes.Image ontology enables the classification of images, image features, interpretations, and common relationships, including relationships between images, shapes, and specific interpretations.
An ideal rational agent should have a measure of assessing his actions from the point of view of the goals set for him.Use the information in incoming perceived data to optimize this measure based on available knowledge.Given various options for action, you should choose (search for) the best one from the point of view of the goal.Data mining aims to obtain knowledge hidden in large amounts of information.It means selection, exploration, and modeling processes performed on large amounts of data, leading to discovering previously unknown business patterns.The idea of data mining is to use the  After downloading information about defined data sources, the algorithm checks whether agent definitions exist in the e-Medicus application.As an agent definition, we understand the conditions that must be met by DICOM files that we want to download from external sources.As for data sources, only definitions marked as Active are downloaded.If the Agent has found active data sources and active agent definitions in the database, it proceeds to the next step.Otherwise, the Agent ends its operation.In the next step, the Agent, using the definition of data sources, downloads a list of all DICOMs available on external servers.After downloading the list of DICOM files with their parameters from external data sources, the program checks whether there is an active agent definition, according to which we have not yet downloaded data.If it does not exist, the agent ends its operation.If an agent definition E. WĄSIK, M. MAZUREK, J. GIRZELSKA has not been checked yet, the algorithm retrieves information from it and checks whether there are files on external data sources that meet the specified conditions.If such files exist, the location of the shared data is retrieved from the data source, and they are automatically downloaded to the e-Medicus system database.The algorithm runs until all agent definitions are checked on all external data sources (Fig. 8).

Conclusions
The proposed system allows for the analysis of cancer cells in terms of many parameters.One of them is the morphometric features of the cell.They describe properties such as cell size, shape, and intensity.The software implements optimization tools that allow you to select the best values of these parameters.Models generated based on collected image analyses may prove helpful in automating the process of early disease diagnosis-collection, segmentation, analysis, and visualization of X-ray images.The main goal of this functionality is to analyze using contour set methods and computational intelligence algorithms to segment dental images by separating individual objects and their fragments.The segmentation must represent the intended level of detail.Separating image fragments with standard features would allow us to precisely define the boundaries between individual tissues and detect anomalies within them.

Figure 2
Figure 2 Sample screens showing how to use software based on the DICOM standard

Figure 3
Figure 3 Image with changes (a) and differences in the image (b) iteracje: 400 / 400

Figure 4 .
Figure 4. Settings panel.They are selecting the number of windows on which images can be displayed.The user can display pictures in up to 16 windows

Figure 7 .
Figure 7.An example of the LSM function for a cell image and a 3D visualization of the contour set function's results ADVANCED IMAGE ANALYSIS FOR MEDICAL DIAGNOSTICS: A SYSTEM FOR SEGMENTATION CLASSIFICATION USING LEVEL … speed of a computer to find regularities in data collected in data warehouses that are hidden from humans (due to the limited time available).