LUNG CANCER DETECTION ON CT IMAGES BY USING …



CHAPTER-1INTRODUCTIONCurrently, cancer is still a serious problem in the world. World Cancer 2014 International Agency for Research on Cancer (IARC) at the World Health Organization that in 2012 there were approximately 14 million new cases of cancer occur. Lung cancer is the most common cause of death with an estimated 8.2 million deaths. According to IARC, about 70 percent of cancer deaths occur in Africa, Asia, Central and South America. Lung cancer is a disease caused by lung cell division that is uncontrolled. If left untreated, the growth of lung cells to grow and spread beyond the lungs. Lung nodules are a circle or oval that is often found on chest radiograph (X-ray) or computed tomography (CT) scan. At one of the 500 reading chest X-ray can be found a nodule. Benign nodules or benign when found in people who are still aged under 40 years. In the X-ray will reveal a picture of a tumour or a liquid, while the CT scans, you will see a tumour, fluid or lymph node enlargement. Furthermore, to ensure nodules or not to be held laboratory tests of samples of sputum and phlegm. It is also taken of lung tissue or gland, for laboratory test. Diagnostic process as above is not effective. Therefore we need software that can automatically detect lung nodules. The end result is software that can detect an existing image in CT lung nodule or artery.1.1 DIGITAL IMAGE PROCESSINGThe identification of objects in an image would probably start with image processing techniques such as noise removal, followed by (low-level) feature extraction to locate lines, regions and possibly areas with certain textures.The clever bit is to interpret collections of these shapes as single objects, e.g. cars on a road, boxes on a conveyor belt or cancerous cells on a microscope slide. One reason this is an AI problem is that an object can appear very different when viewed from different angles or under different lighting. Another problem is deciding what features belong to what object and which are background or shadows etc. The human visual system performs these tasks mostly unconsciously but a computer requires skilful programming and lots of processing power to approach human performance. Manipulating data in the form of an image through several possible techniques. An image is usually interpreted as a two-dimensional array of brightness values, and is most familiarly represented by such patterns as those of a photographic print, slide, television screen, or movie screen. An image can be processed optically or digitally with a computer.To digitally process an image, it is first necessary to reduce the image to a series of numbers that can be manipulated by the computer. Each number representing the brightness value of the image at a particular location is called a picture element, or pixel. A typical digitized image may have 512 × 512 or roughly 250,000?pixels, although much larger images are becoming common. Once the image has been digitized, there are three basic operations that can be performed on it in the computer. For a point operation, a pixel value in the output image depends on a single pixel value in the input image. For local operations, several neighbouring pixels in the input image determine the value of an output image pixel. In a global operation, all of the input image pixels contribute to an output image pixel value. These operations, taken? HYPERLINK "; \t "_top" singly?or in combination, are the means by which the image is enhanced, restored, or compressed. An image is enhanced when it is modified so that the information it contains is more clearly evident, but enhancement can also include making the image more visually appealing. An example is noise smoothing. To smooth a? HYPERLINK "; \t "_top" noisy?image, median filtering can be applied with a 3 × 3 pixel window. This means that the value of every pixel in the noisy image is recorded, along with the values of its nearest eight neighbours. These nine numbers are then ordered according to size, and the median is selected as the value for the pixel in the new image. As the 3 × 3 window is moved one pixel at a time across the noisy image, the filtered image is formed.Another example of enhancement is contrast manipulation, where each pixel's value in the new image depends solely on that pixel's value in the old image; in other words, this is a point operation. Contrast manipulation is commonly performed by adjusting the brightness and contrast controls on a television set, or by controlling the exposure and development time in? HYPERLINK "; \t "_top" printmaking. Another point operation is that of? HYPERLINK "; \t "_top" pseudo colouring?a black-and-white image, by assigning arbitrary colours to the gray levels. This technique is popular in? HYPERLINK "; \t "_top" thermograph?(the imaging of heat), where hotter objects (with high pixel values) are assigned one color (for example, red), and cool objects (with low pixel values) are assigned another color (for example, blue), with other colours assigned to intermediate values.Recognizing object classes in real-world images is a long standing goal in Computer vision. Conceptually, this is challenging due to large appearance variations of object instances belonging to the same class. Additionally, distortions from background clutter, scale, and viewpoint variations can render appearances of even the same object instance to be vastly different. Further challenges arise from interclass similarity in which instances from different classes can appear very similar. Consequently, models for object classes must be flexible enough to accommodate class variability, yet discriminative enough to sieve out true object instances in cluttered images. These seemingly paradoxical requirements of an object class model make recognition difficult. This paper addresses two goals of recognition are image classification and object detection. The task of image classification is to determine if an object class is present in an image, while object detection localizes all instances of that class from an image. Toward these goals, the main contribution in this paper is an approach for object class recognition that employs edge information only. The novelty of our approach is that we represent contours by very simple and generic shape primitives of line segments and ellipses, coupled with a flexible method to learn discriminative primitive combinations. These primitives are complementary in nature, where line segment models straight contour and ellipse models curved contour. We choose an ellipse as it is one of the simplest circular shapes, yet is sufficiently flexible to model curved shapes. These shape primitives possess several attractive properties. First, unlike edge-based descriptors they support abstract and perceptually meaningful reasoning like parallelism and adjacency. Also, unlike contour fragment features, storage demands by these primitives are independent of object size and are efficiently represented with four parameters for a line and five parameters for an ellipse. Additionally, matching between primitives can be efficiently computed (e.g., with geometric properties), unlike contour fragments, which require comparisons between individual edge pixels. Finally, as geometric properties are easily scale normalized, they simplify matching across scales. In contrast, contour fragments are not scale invariant, and one is forced either to rescale fragments, which introduces aliasing effects (e.g., when edge pixels are pulled apart), or to resize an image before extracting fragments, which degrades image resolution. The generic nature of line segments and ellipses affords them an innate ability to represent complex shapes and structures. While individually less distinctive, by combining a number of these primitives, we empower a combination to be sufficiently discriminative. Here, each combination is a two-layer abstraction of primitives pairs of primitives (termed shape tokens) at the first layer, and a learned number of shape tokens at the second layer. We do not constrain a combination to have a fixed number of shape-tokens, but allow it to automatically and flexibly adapt to an object class. This number influences a combination’s ability to represent shapes, where simple shapes favour fewer shape-tokens than complex ones. Consequently, discriminative combinations of varying complexity can be exploited to represent an object class. We learn this combination by exploiting distinguishing shape, geometric, and structural constraints of an object class. Shape constraints describe the visual aspect of shape tokens, while geometric constraints describe its spatial layout (configurations). Structural constraints enforce possible poses/structures of an object by the relationships (e.g., XOR relationship) between shape-tokens. 1.2 CLASSIFICATION OF IMAGES There are 3 types of images used in Digital Image Processing. They areBinary ImageGray Scale ImageColor Image1.2.1 BINARY IMAGEA?binary image is a? HYPERLINK "; digital image?that has only two possible values for each? HYPERLINK "; pixel.??Typically the two colours used for a binary image are black and white though any two colours can be used.??The colour used for the object(s) in the image is the foreground colour while the rest of the image is the background colour. Fig 1.1 Binary imageBinary images are also called?bi-level?or?two-level. This means that each pixel is stored as a single bit (0 or 1).This name black and white, monochrome or monochromatic are often used for this concept, but may also designate any images that have only one sample per pixel, such as? HYPERLINK "; \o "Grayscale" grayscale images. Binary images often arise in? HYPERLINK "; digital image processing?as? HYPERLINK "(image_processing)&action=edit&redlink=1" \o "Mask (image processing) (page does not exist)" masks?or as the result of certain operations such as? HYPERLINK "(image_processing)" \o "Segmentation (image processing)" segmentation,? HYPERLINK "(image_processing)" \o "Thresholding (image processing)" thresholding, and? HYPERLINK "; \o "Dither" dithering. Some input/output devices, such as? HYPERLINK "; \o "Laser printer" laser printers,? HYPERLINK "; \o "Fax" fax machines, and bi-level? HYPERLINK "; \o "Visual display unit" computer displays, can only handle bi-level images1.2.2 GRAY SCALE IMAGEA?grayscale Image?is? HYPERLINK "; digital image?is an image in which the value of each? HYPERLINK "; pixel?is a single? HYPERLINK "(signal)" \o "Sample (signal)" sample, that is, it carries only? HYPERLINK "; \o "Luminous intensity" intensity?information. Images of this sort, also known as? HYPERLINK "; black-and-white, are composed exclusively of shades of? HYPERLINK "; \o "Gray" gray (0-255), varying from black (0) at the weakest intensity to white (255) at the strongest.Grayscale images are distinct from one-bit? HYPERLINK "; black-and-white?images, which in the context of computer imaging are images with only the two? HYPERLINK "; \o "Color" colors,? HYPERLINK "; black, and? HYPERLINK "; white?(also called?bi-level?or? HYPERLINK "; \o "Binary image" binary images). Grayscale images have many shades of gray in between. Grayscale images are also called HYPERLINK "; \o "Monochromatic" monochromatic, denoting the absence of any? HYPERLINK "; \o "Chromaticity" chromatic?variation.Fig 1.2 Gray scale imageGrayscale images are often the result of measuring the intensity of light at each pixel in a single band of the? HYPERLINK "; electromagnetic spectrum?(e.g.? HYPERLINK "; infrared,? HYPERLINK "; \o "Visible spectrum" visible light,? HYPERLINK "; ultraviolet, etc.), and in such cases they are monochromatic proper when only a given? HYPERLINK "; frequency?is captured. But also they can be synthesized from a full color image; see the section about converting to greyscale.1.2.3 COLOUR IMAGEA?(digital) colour image?is a? HYPERLINK "; digital image?that includes? HYPERLINK "; colour?information for each? HYPERLINK "; pixel. Each pixel has a particular value which determines it’s appearing colour. This value is qualified by three numbers giving the?decomposition of the colour in the three primary colours?Red, Green and Blue. Any colour visible to human eye can be represented this way. The decomposition of a colour in the three primary colours is quantified by?a number between 0 and 255. For example, white will be coded as R = 255, G = 255, B = 255; black will be known as (R,G,B) = (0,0,0); and say, bright pink will be : (255,0,255). In other words, an image is an enormous two-dimensional array of colour values, pixels, each of them coded on 3 bytes, representing the three primary colours. This allows the image to contain a total of 256x256x256 = 16.8 million different colours. This technique is also known as?RGB encoding, and is specifically adapted to human vision.Fig 1.3 Colour imageIt is observable that our behaviour and social interaction are greatly influenced by emotions of people whom we intend to interact with. Hence a successful emotion recognition system could have great impact in improving human computer interaction systems in such a way as to make them be more user-friendly and acting more human-like.Moreover, there are a number of applications where emotion recognition can play an important role including biometric authentication, high-technology surveillance and security systems, image retrieval, and passive demographical data collections.It is unarguable that face is one the most important feature that characterises human beings. By only looking ones’ faces, we are not only able to tell who they are but also perceive a lot of information such as their emotions, ages and genders.This is why emotion recognition by face has received much interest in computer vision research community over past two decades.CHAPTER-2LITERATURE SURVEYAll researchers have aim to develop such a system which predict and detect the cancer in its early stages. Also tried to improve the accuracy of the Early Prediction and Detection system by pre-processing, segmentation feature extraction and classification techniques of extracted database. The major contributions of the research are summarized below. T. Sowmiya, M. Gopi, M. New Begin, L.Thomas Robinson - They described Cancer as the most dangerous diseases in the world. Lung cancer is one of the most dangerous cancer types in the world. These diseases can spread worldwide by uncontrolled cell growth in the tissues of the lung. Early detection of the cancer can save the life and survivability of the patients who affected by this diseases. In this paper we survey several aspects of data mining procedures which are used for lung cancer prediction for the patients. Data mining concepts is useful in lung cancer classification. We also reviewed the aspects of ant colony optimization (ACO) technique in data mining. Ant colony optimization helps in increasing or decreasing the disease prediction value of the diseases. This case study assorted data mining and ant colony optimization techniques for appropriate rule generation and classifications on diseases, which pilot to exact Lung cancer classifications. In additionally to, it provides basic framework for further improvement in medical diagnosis on lung cancer.Ada?, Rajneet Kaur? (2013) – Here it uses a computational procedure that sort the images into groups according to their similarities. In this paper Histogram Equalization is used for pre-processing of the images and feature extraction process and neural network classifier to check the state of a patient in its early stage whether it is normal or abnormal. After that we predict the survival rate of a patient by extracted features. Experimental analysis is made with dataset to evaluate the performance of the different classifiers. The performance is based on the correct and incorrect classification of the classifier. In this paper Neural Network Algorithm is implemented using open source and its performance is compared to other classification algorithms. It shows the best results with highest TP Rate and lowest FP Rate and in case of correctly classification, it gives the 96.04% result as compare to other classifiers.Dasu Vaman Ravi Prasad (2013) – Here image quality and accuracy is the core factors of this research, image quality assessment as well as improvement are depending on the enhancement stage where low pre-processing techniques is used based on Gabor filter within Gaussian rules. Following the segmentation principles, an enhanced region of the object of interest that is used as a basic foundation of feature extraction is obtained. Relying on general features, a normality comparison is made. In this research, the main detected features for accurate images comparison are pixels percentage and mask-labelling. S Vishukumar K. Patela and Pavan Shrivastavab (2012) - In this paper authors mostly focus on significant improvement in contrast of masses along with the suppression of background tissues is obtained by tuning the parameters of the proposed transformation function in the specified range. The manual analysis of the sputum samples is time consuming, inaccurate and requires intensive trained person to avoid diagnostic errors. The segmentation results will be used as a base for a Computer Aided Diagnosis (CAD) system for early detection of cancer, which improves the chances of survival for the patient. In this paper, authors proposed gabor filter for enhancement of medical images. It is a very good enhancement tool for medical images. Fatma Taher1,*, Naoufel Werghi1, Hussain Al-Ahmad1, Rachid Sammouda2 (2012) This paper presents two segmentation methods, Hopfield Neural Network (HNN) and a Fuzzy C-Mean (FCM) clustering algorithm, for segmenting sputum color images to detect the lung cancer in its early stages. The manual analysis of the sputum samples is time consuming, inaccurate and requires intensive trained person to avoid diagnostic errors. The segmentation results will be used as a base for a Computer Aided Diagnosis (CAD) system for early detection of lung cancer which will improve the chances of survival for the patient. However, the extreme variation in the gray level and the relative contrast among the images make the segmentation results less accurate, thus we applied a thresholding technique as a pre-processing step in all images to extract the nuclei and cytoplasm regions, because most of the quantitative procedures are based on the nuclear feature. The thresholding algorithm succeeded in extracting the nuclei and cytoplasm regions. Moreover, it succeeded in determining the best range of thresholding values. The HNN and FCM methods are designed to classify the image of N pixels among M classes. In this study, we used 1000 sputum color images to test both methods, and HNN has shown a better classification result than FCM, the HNN succeeded in extracting the nuclei and cy-toplasm regions. In this paper authors uses a rule based thresholding classifier as a pre-processing step. The thresh-olding classifier is succeeded in solving the problem of in-tensity variation and in detecting the nuclei and cytoplasm regions, it has the ability to mask all the debris cells and to determine the best rang of threshold values. Overall, the thresholding classifier has achieved a good accuracy of 98% with high value of sensitivity and specificity of 83% and 99% respectivelyCHAPTER-3PROPOSED SYSTEM With the advances in imaging technology, diagnostic imaging has become an indispensable tool in medicine today. X-ray angiography (XRA), magnetic resonance angiography (MRA), magnetic resonance imaging (CT), computed tomography (CT), and other imaging modalities are heavily used in clinical practice. Such images provide complementary information about the patient. While increased size and volume in medical images required the automation of the diagnosis process, the latest advances in computer technology and reduced costs have made it possible to develop such systems. Lung tumor detection on medical images forms an essential step in solving several practical applications such as diagnosis of the tumors and registration of patient images obtained at different times. Segmentation algorithms form the essence of medical image applications such as radiological diagnostic systems, multimodal image registration, creating anatomical atlases, visualization, and computer-aided surgery Tumor segmentation algorithms are the key components of automated radiological diagnostic systems. Segmentation methods vary depending on the imaging modality, application domain, method being automatic or semi-automatic, and other specific factors. There is no single segmentation method that can extract vasculature from every medical image modality. While some methods employ pure intensity-based pattern recognition techniques such as thresholding followed by connected component analysis, some other methods apply explicit tumor models to extract the tumor contours. Depending on the image quality and the general image artifacts such as noise, some segmentation methods may require image preprocessing prior to the segmentation algorithm. On the other hand, some methods apply post-processing to overcome the problems arising from over segmentation. Medical image segmentation algorithms and techniques can be divided into six main categories, pattern recognition techniques, model-based approaches, tracking-based approaches, artificial intelligence-based approaches, neural network-based approaches, and miscellaneous tube-like object detection approaches. Pattern recognition techniques are further divided into seven categories, multi-scale approaches, skeleton-based approaches, region growing approaches, ridge-based approaches, differential geometry-based approaches, matching filters approaches, and mathematical morphology schemes. Clustering analysis plays an important role in scientific research and commercial application. This thesis provides a survey of current tumour segmentation methods using clustering approach and provides both early and recent literature related to tumour segmentation algorithms and techniques. 3.1 REGION GROWING APPROACHRegion growing technique segments image pixels that are belong to an object into regions. Segmentation is performed based on some predefined criteria. Two pixels can be grouped together if they have the same intensity characteristics or if they are close to each other. It is assumed that pixels that are closed to each other and have similar intensity values are likely to belong to the same object. The simplest form of the segmentation can be achieved through thresholding and component labeling. Another method is to find region boundaries using edge detection. Segmentation process, then, uses region boundary information to extract the regions. The main disadvantage of region growing approach is that it often requires a seed point as the starting point of the segmentation process. This requires user interaction. Due to the variations in image intensities and noise, region growing can result in holes and over segmentation. Thus, it sometimes requires post-processing of the segmentation result.Existing methodPartial derivatives.Wavelet based denoising.Thresholding and K means clustering methods for segmentation.DrawbacksLoss of edge details.In wavelet denoising, failure to detect edge details at curved region.K means - It is not suitable for all lighting condition of images.Difficult to measure the cluster quality.3.2 BLOCK DIAGRAM OF PROPOSED SYSTEMFig 3.1 Block diagramImage Pre-processing Firstly, in image pre-processing median filter is used on grayscale image of CT scan images. Some noises are embedded on CT Images at the time of image acquisition process which aids in false detection of nodules. Noise may be detected as cancer nodules sometimes. Therefore, these noises have to be removed for accurate detection of cancer. Median filter removes salt and pepper noise from the CT images. After median filter, Gaussian filter is implemented. It smoothes the image and removes speckle noise from image. Segmentation This process locates objects or boundaries which help in acquiring the region of interest in the image. It partitions the image into regions to identify the meaningful information. In lung cancer detection it segments the cancer nodule from the CT scan image. In the proposed model watershed segmentation is implemented. Its main feature is that it can separate and identify the touching objects in the image. This feature helps in proper segmentation of cancer nodules if it is touching to other false nodules. Features extraction In this stage, features like area, perimeter, centroid, diameter, eccentricity and Mean intensity. These features later on are used as training features to develop classifier. Classification This stage classifies the detected nodule as malignant or benign. Support vector machine (SVM) is used as classifier. It is supervised machine learning method. SVM defines the function that classifies data into two classes. The function is defined as D(x)=wT xi+ b where xi are training inputs, wT is m dimensional vector, and b is bias term. Here, i=1…. M. D(x)=wT xi+ b ≥ 1 for yi=1 D(x)=wT xi+ b ≤-1 for yi=-1DescriptionThe Project proposes to spot the tumour from CT scanned medical images using multi clustering model and morphological process. The segmentation refers to the process of partitioning a digital image into multiple segments.The brain CT is taken, and its noises are removed using filters and then applied spatial Fuzzy C means Clustering algorithm for the segmentation of CT brain images. The morphological process will be used to smooth the tumour region from the noisy background. The segmented primary and secondary regions are compressed with hybrid techniques for telemedicine application. 3.3 PREPROCESSINGImage restoration is the operation of taking a corrupted/noisy image and estimating the clean original image. Corruption may come in many forms such as motion blur, noise, and camera misfocus. Image restoration is different from image enhancement in that the latter is designed to emphasize features of the image that make the image more pleasing to the observer, but not necessarily to produce realistic data from a scientific point of view. Image enhancement techniques (like contrast stretching or de-blurring by a nearest neighbour procedure) provided by "Imaging packages" use no a priori model of the process that created the image. With image enhancement noise can be effectively be removed by sacrificing some resolution, but this is not acceptable in many applications. In a Fluorescence Microscope resolution in the z-direction is bad as it is. More advanced image processing techniques must be applied to recover the object. Deconvolution is an example of image restoration method. It is capable of: Increasing resolution, especially in the axial direction removing noise increasing contrast.3.3.1 Dual-tree complex wavelet transforms (DT-CWT)The dual-tree complex wavelet transform (CWT) is a relatively recent enhancement to the discrete wavelet transform (DWT), with important additional properties: It is nearly shift invariant and directionally selective in two and higher dimensions. It achieves this with a redundancy factor of only 2d for d-dimensional signals, which is substantially lower than the undecimated DWT. The multidimensional (M-D) dual-tree CWT is no separable but is based on a computationally efficient, separable filter bank (FB). The theory behind the dual-tree transforms shows how complex wavelets with good properties can be designed, and illustrates a range of applications in signal and image processing.Fig 3.2 The value of the wavelet coefficient in “Real-Valued Discrete Wavelet Transform and Filter BanksIn the neighbourhood of an edge, the real DWT produces both large and small wavelet coefficients. In contrast, the (approximately) analytic CWT produces coefficients whose magnitudes are more directly related to their proximity to the edge. Here, the test signal is a step edge at n = no, x(n) = u(n ? no). The figure shows the value of the wavelet coefficient d(0, 8) (the eighth coefficient at stage 3 in “Real-Valued Discrete Wavelet Transform and Filter Banks, as a function of no. In the top panel, the real coefficient d(0, 8) is computed using the conventional real DWT. In the lower panel, the complex coefficient (0, 8) is computed using the dual-tree CWT.3.3.2 Wavelet transform and multistate analysisThe wavelet transform has been exploited with great success across the gamut of signal processing applications, in the process, often redefining the state of the art performance. In a nutshell, the DWT replaces the infinitely oscillating sinusoidal basis functions of the Fourier transform with a set of locally oscillating basis functions called wavelets. In the classical setting, the wavelets are stretched and shifted versions of a fundamental, real-valued band pass wavelet ψ(t ). When carefully chosen and combined with shifts of a real-valued low-pass scaling function φ(t ), they form an orthonormal basis expansion for one-dimensional (1-D) real-valued continuous-time signals. That is, any finite energy analog signal x(t ) can be decomposed in terms of wavelets and scaling functions via The scaling coefficients c(n) and wavelet coefficients d( j, n) are computed via the inner products,They provide a time-frequency analysis of the signal by measuring its frequency content (controlled by the scale factor j) at different times (controlled by the time shift n).There exists a very efficient, linear time complexity algorithm to compute the coefficients c(n) and d( j, n) from a fine-scale representation of the signal (often simply N samples) and vice versa based on two octave-band, discrete-time FBs that recursively apply a discrete-time low-pass filter h0(n), a high-pass filterh1(n), and up-sampling and down-sampling operations. These filters provide a convenient parameterization for designing wavelets and scaling functions with desirable properties, such as compact time support and fast frequency decay (to ensure the analysis is as local as possible in time frequency) and orthogonality to low-order polynomials (vanishing moments)This corresponds to a rotation of both filters in the z-plane by 90°. If h0(n) and h1(n) satisfy the PR conditions, then so will hp(n) and hn(n). The given low-pass/high-pass filtersh0(n), h1(n) illustrated in the frequency domain, the complex filters hp(n), hn(n) are illustrated in the frequency domain in Figure 4. When used by itself, this complex can effectively separate the positive and negative frequency components of a signal; in a discrete-time sense, hp(n) and hn(n) are approximately analytic.Fig 3.3 Analysis FB for the DWT with invertible complex post-filtering.3.3.3 Shift VarianceA small shift of the signal greatly perturbs the wavelet coefficient oscillation pattern around singularities. Shift variance also complicates wavelet-domain processing algorithms must be made capable of coping with the wide range of possible wavelet coefficient patterns caused by shifted singularities Fig 3.4 A q-shift complex wavelet corresponding to a set of orthonormal dual-tree filters of lengthTo better understand wavelet coefficient oscillations and shift variance, consider a piecewise smooth signal x(t?t0) like the step functionAnalysed by a wavelet basis having a enough vanishing moments. Its wavelet coefficients consist of samples of the step response of the wavelet48577519050Where is the height of the jump: Since ψ(t ) is a band pass function that oscillates around zero, so does its step response( j, n) as a function of n (recall Figure 1). Moreover, the factor2 j in the upper limit (j≥ 0) amplifies the sensitivity of d( j, n)to the time shift t0, leading to strong shift variance.3.3.4 Complex WaveletsThe key is to note that the Fourier transform does not suffer from these problems. First, the magnitude of the Fourier transform does not oscillate positive and negative but rather provides a smooth positive envelope in the Fourier domain. Second, the magnitude of the Fourier transform is perfectly shifting invariant, with a simple linear phase offset encoding the shift. Third, the Fourier coefficients are not aliased and do not rely on a complicated aliasing cancellation property to reconstruct the signal and fourth, the sinusoids of them-D Fourier basis are highly directional plane waves. The DWT, which is based on real-valued oscillating wavelets, the Fourier transform is based on complex-valued oscillating sinusoids.The oscillating cosine and sine components (the real and imaginary parts, respectively) form a Hilbert transform pair; i.e., they are 90? out of phase with each other. Together they constitute an analytic signal ejtthat is supported on only one-half of the frequency axis (_ >0).The oscillating cosine and sine components (the real and imaginary parts, respectively) form a Hilbert transform pair; i.e., they are 90? out of phase with each other. Together they constitute an analytic signal ejtthat is supported on only one-half of the frequency axis (_ >0). 3.4 CLUSTERINGClustering can be considered the most important unsupervised learning problem, so, it deals with finding a structure in a collection of unlabeled data. A cluster is therefore a collection of objects which are “similar” between them and are “dissimilar” to the objects belonging to other clustersClustering algorithms may be classified as listed belowExclusive ClusteringOverlapping ClusteringHierarchical ClusteringProbabilistic Clustering In the first case data are grouped in an exclusive way, so that if a certain datum belongs to a definite cluster then it could not be included in another cluster. On the contrary the second type, the overlapping clustering, uses fuzzy sets to cluster data, so that each point may belong to two or more clusters with different degrees of membership. In this case, data will be associated to an appropriate membership value. A hierarchical clustering algorithm is based on the union between the two nearest clusters. The beginning condition is realized by setting every datum as a cluster. After a few iterations it reaches the final clusters wanted.3.4.1 K-MEANS CLUSTERINGCluster analysis, an important technology in data mining, is an effective method of analysing and discovering useful information from numerous data. Cluster algorithm groups the data into classes or clusters so that objects within a cluster have high similarity in comparison to one another but are very dissimilar to objects in other clusters. Dissimilarities are assessed based on the attribute values describing the objects. Often, distance measures are used. As a branch of statistics and an example of unsupervised learning, clustering provides us an exact and subtle analysis tool from the mathematic view K-means algorithm belongs to a popular partition method in cluster analysis. The most widely used clustering error criterion is squared-error criterion, it can be defined asWhere J, is the sum of square-error for all objects in the database, xk is the point in space representing a given object, and mj is the mean of cluster Cj. Adopting the squared-error criterion, K-means works well when the clusters are compact clouds that are rather well separated from one another and are not suitable for discovering clusters with no convex shapes or clusters of very different size. For attempting to minimize the square-emor criterion, it will divide the objects in one cluster into two or more clusters. In addition to that, when applying this square-error criterion to evaluate the clustering results, the optimal cluster corresponds to the extremum. Since the objective function has many local minimal values, if the result of initialization is exactly near the local minimal point, the algorithm will terminate at a local optimum. So, random selecting initial cluster centre is easy to get in the local optimum not the entire optimal. For overcoming that square-error criterion is hard toDistinguish the big difference among the clusters, one technique has been developed which is based on representative point-based technique. Besides, there areVarious approaches to solving the problem that the performance of algorithm heavily depends on the initial starting conditions: the simplest one is repetition with different random selections some algorithms also employ simulation anneals technique to avoid getting into local optimal. The idea is that multiple sub-samples are drawn from the dataset clustered independently, and then these solutions are clustered again respectively, the refined initial centre is then chosen as the solution having minimal distortion over all solutions. Aiming at the dependency to initial conditions and the limitation of K-means algorithm that applies the square-error criterion to measure the quality of clustering, this paper presents a new improved K-means algorithm that is based on effective techniques of multi-sampling and once-clustering to search the optimal initial values of cluster centres. Our experimental results demonstrate the new algorithm can obtain better stability and excel the original K-means in clustering results. 3.4.2 CLUSTERING MODELClustering can be considered the most important unsupervised learning problem, so, it deals with finding a structure in a collection of unlabeled data. A cluster is therefore a collection of objects which are “similar” between them and are “dissimilar” to the objects belonging to other clusters.3.4.3 FUZZY CLUSTERING MODELFuzzy clustering plays an important role in solving problems in the areas of pattern recognition and fuzzy model identification. A variety of fuzzy clustering methods have been proposed and most of them are based upon distance criteria. One widely used algorithm is the fuzzy c-means (FCM) algorithm. It uses reciprocal distance to compute fuzzy weights. A more efficient algorithm is the new FCFM. It computes the cluster centre using Gaussian weights, uses large initial prototypes, and adds processes of eliminating, clustering and merging. In the following sections we discuss and compare the FCM algorithm and FCFM algorithm. Spatial Fuzzy C Means method incorporates spatial information, and the membership weighting of each cluster is altered after the cluster distribution in the neighbourhood is considered. The first pass is the same as that in standard FCM to calculate the membership function in the spectral domain. In the second pass, the membership information of each pixel is mapped to the spatial domain and the spatial function is computed from that. The FCM iteration proceeds with the new membership that is incorporated with the spatial function. The iteration is stopped when the maximum difference between cluster centres or membership functions at two successive iterations is less than a least threshold value. The fuzzy c-means (FCM) algorithm was introduced by J. C. Bezdek. The idea of FCM is using the weights that minimize the total weighted mean-square error:J(wqk, z(k)) = (k=1,K) (k=1,K) (wqk)|| x(q)- z(k)||2(k=1,K) (wqk) = 1 wqk = (1/(Dqk)2)1/(p-1) / (k=1,K) (1/(Dqk)2)1/(p-1) , p > 1The FCM allows each feature vector to belong to every cluster with a fuzzy truth value (between 0 and 1), which is computed using Equation (4). The algorithm assigns a feature vector to a cluster according to the maximum weight of the feature vector over all clusters.3.4.4 A New Fuzzy c-means ImplementationAlgorithm FlowInitialize the Fuzzy Weights. In order to comparing the FCM with FCFM, our implementation allows the user to choose initializing the weights using feature vectors or randomly. The process of initializing the weights using feature vectors assigns the first Kinit (user-given) feature vectors to prototypes then computes the weights by Equation (4).Standardize the Weights over Q. During the FCM iteration, the computed cluster centres get closer and closer. To avoid the rapid convergence and always grouping into one cluster, we usew[q,k] = (w[q,k] – wmin)/( wmax – wmin)Before standardizing the weights over Q. Where wmax, wmin are maximum or minimum weights over the weights of all feature vectors for the particular class prototype.Eliminating Empty Clusters. After the fuzzy clustering loop we add a step (Step 8) to eliminate the empty clusters. This step is put outside the fuzzy clustering loop and before calculation of modified XB validity. Without the elimination, the minimum distance of prototype pair used in Equation (8) may be the distance of empty cluster pair. We call the method of eliminating small clusters by passing 0 to the process so it will only eliminate the empty clusters. After the fuzzy c-means iteration, for the purpose of comparison and to pick the optimal result, we add Step 9 to calculate the cluster centres and the modified Xie-Beni clustering validity The Xie-Beni validity is a product of compactness and separation measures. The compactness-to-separation ratio is defined by Equation (6). = {(1/K)(k=1,K)k2}/Dmin2k2 = (q=1,Q) wqk || x(q) – c(k) ||2Dmin is the minimum distance between the cluster centres.The Modified Xie-Beni validity is defined as = Dmin2/ {(k=1,K)k2 }]The variance of each cluster is calculated by summing over only the members of each cluster rather than over all Q for each cluster, which contrasts with the original Xie-Beni validity measure.k2 ={q: q is in cluster k} wqk || x(q) – c(k) ||2The spatial function is included into membership function as given in Equation3.5 SEGMENTATIONImage segmentation is a crucial process for most image analysis consequent tasks. Especially, most of the existing techniques for image description and recognition are highly depend on the segmentation results. Segmentation splits the image into its constituent regions or objects. Segmentation of medical images in 2D has many beneficial applications for the medical professional such as: visualization and volume estimation of objects of concern, detection of oddities, tissue quantification and organization and many more. The main objective of segmentation is to simplify and change the representation of the image into something that is more significant and easier to examine. Image segmentation is usually used to trace objects and borders such as lines, curves, etc. in images. More accurately, image segmentation is the process of allocating a label to every pixel in an image such that pixels with the same label share certain pictorial features. The outcome of image segmentation is a set of segments that collectively cover the entire image, or a set of edges extracted from the image i.e. edge detection. In a given region all pixels are similar relating to some distinctive or computed property, such as texture, intensity or color. With respect to the same characteristics adjacent regions are significantly different. One of two basic properties of intensity values Segmentation algorithms are based on: discontinuity and similarity. In the first group we partition the image based on abrupt changes in intensity, such as edges in an image. The next group is based on segregating the image into regions that are alike according to a predefined criterion. Histogram thresholding methodology comes under this group.3.5.1 K-MEANS SEGMENTATIONK-means is one of the simplest unsupervised learning algorithms that solve the well known clustering problem. The procedure follows a simple and easy way to classify a given data set through a certain number of clusters (assume k clusters) fixed a prior. The main idea is to define k centroids, one for each cluster. These centroids should be placed in a cunning way because of different location causes different result. So, the better choice is to place them as much as possible far away from each other. The next step is to take each point belonging to a given data set and associate it to the nearest centroid. When no point is pending, the first step is completed and an early group age is done. At this point we need to re-calculate k new centroids as bray centers of the clusters resulting from the previous step. After we have these k new centroids, a new binding has to be done between the same data set points and the nearest new centroid. A loop has been generated. As a result of this loop we may notice that the k centroids change their location step by step until no more changes are done. In other words centroids do not move any more. Finally, this algorithm aims at minimizing an objective function, in this case a squared error function. 3.5.2 HIERARCHICAL SEGMENTATIONA hierarchical set of image segmentations is a set of several image segmentations of the same image at different levels of detail in which the segmentations at coarser levels of detail can be produced from simple merges of regions at finer levels of detail. A unique feature of hierarchical segmentation is that the segment or region boundaries are maintained at the full image spatial resolution for all segmentations. In a hierarchical segmentation, an object of interest may be represented by multiple image segments in finer levels of detail in the segmentation hierarchy and may be merged into a surrounding region at coarser levels of detail in the segmentation hierarchy. If the segmentation hierarchy has sufficient resolution, the object of interest will be represented as a single region segment at some intermediate level of segmentation detail. A goal of the subject analysis of the segmentation hierarchy is to identify the hierarchical level at which the object of interest is represented by a single region segment. The object may then be identified through its spectral and spatial characteristics. Additional clues for object identification may be obtained from the behaviour of the image segmentations at the hierarchical segmentation level above and below the level at which the object of interest is represented by a single region.3.6 THRESHOLDINGThe simplest method of image segmentation is called the thresholding method. This method is based on a clip-level (or a threshold value) to turn a gray-scale image into a binary image. The key of this method is to select the threshold value (or values when multiple-levels are selected). Several popular methods are used in industry including the maximum entropy method, Otsu's method (maximum variance), and k-means clustering. Recently, methods have been developed for thresholding computed tomography (CT) images. The key idea is that, unlike Otsu's method, the thresholds are derived from the radiographs instead of the (reconstructed) image.Design Steps(1) Set the initial threshold T= (the maximum value of the image brightness + the minimum value of the image brightness)/2.(2) Using T segment the image to get two sets of pixels B (all the pixel values are less than T) and N (all the pixel values are greater than T);(3) Calculate the average value of B and N separately, mean ub and un.(4) Calculate the new threshold: T= (ub+un)/2(5) Repeat Second steps to fourth steps up to iterative conditions are met and get necessary region from the brain image.3.7ALGORITHM FOR GETTING INITIAL CENTROIDSNow let's review the standard k-means algorithm. Input: the number of classes and the population U thatOutput: k classes that satisfy the least square error. The process of the algorithm is containing n objects. (1) Select k objects randomly from the population U as the initial centroids.(2) Repeat (3) and (4) until no object changes the class t belongs to.(3) Compute the distances between each object & and all centroids, and if one object has the shortest distance from one centroid with rigid to the other centroids then it has the same name as the centroid all these objects that have the same name belong to the same class.(4) Average all the vectors of objects belonging to the same class and form the new centroids. The standard k-means algorithm alternates between assigning the data-points to their closest centroid (the E-step) and moving each centroid to the mean of its assigned data-points (the M-step)"'. Because the standard k-means algorithm gets easily trapped in a local minimum and different initial centroids lead to different results, if we find certain initial centroids that are consistent with the distribution of data, then a better clustering can be obtained. The aim of k-means algorithm is to partition objects into several classes and to make the distances between objects in the same class closer than the distances between objects in different classes. So, if certain centroids in which each centroid represents a group of similar objects can be obtained, we will find out the centroids consistent with the distribution of data. Let U be a data-point set. The initial centroids can be gotten by the following steps. Firstly, compute the distances between each data-point and all the other data-points in U. Secondly find out the two data-points between which the distance is the shortest and form a data-point set AI which contains these two data-points, then we delete them from the population U. Thirdly. compute distances between each data-point in AI and each data-point in U, find out the data-point that is closest to the data-point set AI (i.e. of all distances, thy distance between this data-point and certain data-point in A1 is shortest), delete it from U and add it to AI. Repeat the third step till the number of data-point in A1 reaches certain threshold. Then we go to step two and form another data-point set till we get k data-point sets. Finally, the initial centroids can be gotten by averaging all the vectors in each data-point set.The algorithm of getting the initial centroidsThe Euclidean distance is used in this paper. The distance between one vector X=(xl,x2,. . .,xn) and the other vector Y=(yl,y2, ...,y n) is described as follows.The distance between a data-point X and a data-point d(X, V) =min (d(X, Y), Y EV)Suppose there are n data-points in the population U and we want to partition U into k classes. Set m=l. Then the algorithm is described as follows. Compute distances between each data-point and all of the other data-points in U; find the two data points between which the distance is the shortest and form a data-point set Am (l<m<k) which contains these two data-points; delete these two data-points from U,(2) Find the data-point in U that is closest to the data-point set Am, add it to Am and delete it from U.(3) Repeat step (2) till the number of data-points inAm reaches(4) If m<k, then m=m+l; find another pair of data-points between which the distance is the shortest in U and form another data-point set Am and delete them from U then go to step (2)5) For each Am (I<m<k) sum the vectors of data-points and divide the sum by the number of data-points in Am, then each data-point set outputs a vector and we select these vectors as the initial centroids.(6) Execute the process of the standard k-means algorithm from step 2.The value of a is different about different data. If the value of a is too small, all the centroids may be obtained in the same region that contains many similar data-points; but if the value of a is too big, the centroids may stay away from the region that contains many similar data-points. According to the results of our experiment,Better clustering can often be obtained if the value of a is set to be 0.75.CHAPTER-4TRANSFORM TECHNIQUES4.1 DISCRETE COSINE TRANSFORM (DCT)In this lab we use the DCT block from the Video Processing Library in Simulink. Still, it is useful to understand the various steps in computing a DCT on an image as given below.First divide the image (N by M pixels) into blocks of 8x8 pixels as shown in Figure.Fig 4.1 Original Image and Image divided into 8x8 blocks.2. Compute the DCT on the 8x8 blocks using the formula given below. Please note that in this lab we use the DCT block from Video Processing Library in Simulink and not the formula given below. Formula to calculate DCT on an 8x8 block image.3. Select the high-frequency components via RxR mask. Please note that both the images are displayed in a log-amplitude scale in Figures 3.1(c) and 3.1(d) below. (b) Fig 4.2(a) 8x8 block image in log amplitude scale Fig 4.2(b) After applying RxR mask on the image where R=4 4. Compute the 8x8 block IDCT (Inverse DCT) on the compressed DCT coefficients using the formula given below. Please note that in this lab we use the IDCT block from the Video and Image Processing Block set in Simulink and not the formula given below.Formula to calculate IDCT on a 8x8 block image5. Figures 3.1(a), 3.1(b) show lossy compression results using DCT with R=3, R=2 and R=1. Please note that R=3 means that we are selecting and transmitting only a 3x3 block from a 8x8 block resulting in a compression of 86%. As the value of R decreases, compression increases but picture quality decreases too.3.1(f) Fig 4.3(a)Original Image. Fig 4.3(b): R=3 (86% compression). Figure 4.4(a): R=2 (93% compression). Figure 4.4(b): R=1 (98% compression).4.2 ENCRYPTIONFor encrypting the video we perform additional actions after Step 3. Just for recap, in Step 3 we select an RxR matrix from the computed 8x8 block of DCT coefficients. To add encryption to the block of RxR DCT co-efficient, we multiply it with a scrambling matrix as shown in Figure below. Please note that this is element-wise matrix multiplication and not the usual matrix multiplication.Scrambling process4.3 DECRYPTIONFor decrypting the video we perform additional actions before Step 4. Just for recap, in Step 4 we apply IDCT on the RxR block of DCT co-efficient. Before computing IDCT we multiply the scrambled RxR block of DCT co-efficient with the de-scrambling matrix as shown in Figure. Please note that the scrambling matrix and the descrambling matrix are the same in our case. Also note that we are doing element-wise matrix multiplication and not the usual matrix multiplication.Scrambling and De-scrambling process4.4 DISADVANTAGES OF DCT1. Only spatial correlation of the pixels inside the single 2-D block is considered and the correlation from the pixels of the neighbouring blocks is neglected2. Impossible to completely decorrelate the blocks at their boundaries using DCT3. Undesirable blocking artifacts affect the reconstructed images or video frames. (High compression ratios or very low bit rates) 4. Scaling as add-onadditional effort5. DCT function is fixedcannot be adapted to source data6. Does not perform efficiently for binary images (fax or pictures of fingerprints) characterized by large periods of constant amplitude (low spatial frequencies), followed by brief periods of sharp transitions4.5 DISCRETE WAVELET TRANSFORMThe wavelet transform (WT) has gained widespread acceptance in signal processing and image compression. Because of their inherent multi-resolution nature, wavelet-coding schemes are especially suitable for applications where scalability and tolerable degradation are important Recently the JPEG committee has released its new image coding standard, JPEG-2000, which has been based upon DWT.Wavelet transform decomposes a signal into a set of basis functions. These basis functions are called wavelets. Wavelets are obtained from a single prototype wavelet y(t) called mother wavelet by dilations and shifting:Where a is the scaling parameter and b is the shifting parameter4.5.1 Theory of WaveletThe wavelet transform is computed separately for different segments of the time-domain signal at different frequencies. Multi-resolution analysis: analyses the signal at different frequencies giving different resolutions MRA is designed to give good time resolution and poor frequency resolution at high frequencies and good frequency resolution and poor time resolution at low frequencies. Good for signal having high frequency components for short durations and low frequency components for long duration.e.g. Images and video frames Theory of WT (cont.) Wavelet transform decomposes a signal into a set of basis functions. These basis functions are called wavelets.Wavelets are obtained from a single prototype wavelet y(t) called mother wavelet by dilations and shiftingWhere a is the scaling parameter and b is the shifting parameter4.5.2 1D-WTThe 1-D wavelet transform is given by:The inverse 1-D wavelet transform is given by:Discrete wavelet transforms (DWT), which transforms a discrete time signal to a discrete wavelet representation. it converts an input series x0, x1, ..xm, into one high-pass wavelet coefficient series and one low-pass wavelet coefficient series (of length n/2 each) given by: Where sm(Z) and tm(Z) are called wavelet filters, K is the length of the filter, and i=0, ..., [n/2]-1. In practice, such transformation will be applied recursively on the low-pass series until the desired number of iterations is reached.4.5.3 Lifting schema of DWTLifting schema of DWT has been recognized as a faster approach.The basic principle is to factorize the polyphase matrix of a wavelet filter into a sequence of alternating upper and lower triangular matrices and a diagonal matrix. This leads to the wavelet implementation by means of banded-matrix multiplications.4.5.4 Two lifting schema Where si(z) (primary lifting steps) and ti(z) (dual lifting steps) are filters and K is a constant. As this factorization is not unique, several {si(z)}, {ti(z)} and K are admissible.4.5.5 2-D DWT for Image2-D DWT for Image:4.6 ADVANTAGES OF DWT OVER DCT1. No need to divide the input coding into non-overlapping 2-D blocks, it has higher compression ratios avoid blocking artifacts.2. Allows good localization both in time and spatial frequency domain.3. Transformation of the whole image introduces inherent scaling4. Better identification of which data is relevant to human perception higher compression ratio5. Higher flexibility: Wavelet function can be freely chosen6. No need to divide the input coding into non-overlapping 2-D blocks, it has higher compression ratios avoid blocking artifacts.7. Transformation of the whole image introduces inherent scaling8. Better identification of which data is relevant to human perception higher compression ratio (64:1 vs. 500:1)9. Performance 10. Peak Signal to Noise ratio used to be a measure of image quality 11. The PSNR between two images having 8 bits per pixel or sample in terms of decibels (dBs) is given by:12. PSNR = 10 log1013. Mean square error (MSE) 14. Generally when PSNR is 40 dB or greater, then the original and the reconstructed images are virtually indistinguishable by human observers 4.7 DISADVANTAGES OF DWT1. The cost of computing DWT as compared to DCT may be higher. 2. The use of larger DWT basis functions or wavelet filters produces blurring and ringing noise near edge regions in images or video frames3. Longer compression time4. Lower quality than JPEG at low compression ratesCHAPTER-5FEATURE EXTRACTION AND NEURAL NETWORK5.1 CO-OCCURRENCE MATRIXOriginally proposed by R.M. Haralick, the co-occurrence matrix representation of texture features explores the grey level spatial dependence of texture]. A mathematical definition of the co-occurrence matrix is as followsGiven a position operator P(i,j),let Abe an n x n matrixWhose element A[i][j] is the number of times that points with grey level (intensity) g[i] occur, in the position specified by P, relative to points with grey level g[j].Let C be the n x n matrix that is produced by dividing A with the total number of point pairs that satisfy P. C[i][j] is a measure of the joint probability that a pair of points satisfying P will have values g[i], g[j].C is called a co-occurrence matrix defined by P.Examples for the operator P are: “i above j”, or “i one position to the right and two below j”, etc. This can also be illustrated as follows… Let t be a translation, then a co-occurrence matrix Ctof a region is defined for every grey-level (a, b) by [1]:falseHere, Ct(a, b) is the number of site-couples, denoted by (s, s + t) that are separated by a translation vector t, with a being the grey-level of s, and b being the grey-level of s + t. For example; with an 8 grey-level image representation and a vector t that considers only one neighbour, we would find:Fig 5.1 Image exampleFig 5.2 Classical Co-occurrence matrixAt first the co-occurrence matrix is constructed, based on the orientation and distance between image pixels. Then meaningful statistics are extracted from the matrix as the texture representation .Haralick proposed the following texture features:EnergyContrastCorrelationHomogenityHence, for each Haralick texture feature, we obtain a co-occurrence matrix. These co-occurrence matrices represent the spatial distribution and the dependence of the grey levels within a local area. Each (i,j) th entry in the matrices, represents the probability of going from one pixel with a grey level of 'i' to another with a grey level of 'j' under a predefined distance and angle. From these matrices, sets of statistical measures are computed, called feature vectors.Energy: It is a gray-scale image texture measure of homogeneity changing, reflecting the distribution of image gray-scale uniformity of weight and texture.p(x,y) is the GLC MContrast: Contrast is the main diagonal near the moment of inertia, which measure the value of the matrix is distributed and images of local changes in number, reflecting the image clarity and texture of shadow depth.Correlation Coefficient: Measures the joint probability occurrence of the specified pixel pairs. Correlation: sum(sum((x- μx)(y-μy)p(x , y)/σxσy))Homogeneity: Measures the closeness of the distribution of elements in the GLCM to the GLCM diagonal.Homogeneity = sum (sum (p(x, y)/ (1 + [x-y])))DrawbacksPoor discriminatory powerHigh computational loadLoss of edge details due to shift variant property.5.2 KNN ClassifierIn?pattern recognition, the?k-nearest neighbour algorithm?(k-NN) is a method for?classifying?objects based on closest training examples in the?feature space.?k-NN is a type of?instance-based learning, or?lazy learning?where the function is only approximated locally and all computation is deferred until classification. The?k-nearest neighbour algorithm is amongst the simplest of all?machine learning?algorithms: an object is classified by a majority vote of its neighbours, with the object being assigned to the class most common amongst its?k?nearest neighbours (k?is a positive?integer, typically small). If?k?= 1, then the object is simply assigned to the class of its nearest neighbour.The same method can be used for?regression, by simply assigning the property value for the object to be the average of the values of its?nearest neighbours. It can be useful to weight the contributions of the neighbours, so that the nearer neighbours contribute more to the average than the more distant ones. (A common weighting scheme is to give each neighbour a weight of 1/d, where?d?is the distance to the neighbour. This scheme is a generalization of linear interpolation.)5.3 NEURAL NETWORKNeural networks are predictive models loosely based on the action of biological neurons. The selection of the name “neural network” was one of the great PR successes of the Twentieth Century. It certainly sounds more exciting than a technical description such as “A network of weighted, additive values with nonlinear transfer functions”. However, despite the name, neural networks are far from “thinking machines” or “artificial brains”. A typical artificial neural network might have a hundred neurons. In comparison, the human nervous system is believed to have about 3x1010 neurons. We are still light years from “Data”. The original “Perceptron” model was developed by Frank Rosenblatt in 1958. Rosenblatt’s model consisted of three layers, (1) a “retina” that distributed inputs to the second layer, (2) “association units” that combine the inputs with weights and trigger a threshold step function which feeds to the output layer, (3) the output layer which combines the values. Unfortunately, the use of a step function in the neurons made the perceptions difficult or impossible to train. A critical analysis of perceptron’s published in 1969 by Marvin Minsky and SeymorePapert pointed out a number of critical weaknesses of perceptron’s, and, for a period of time, interest in perceptron’s waned. Interest in neural networks was revived in 1986 when David Rumelhart, Geoffrey Hinton and Ronald Williams published “Learning Internal Representations by Error Propagation”. They proposed a multilayer neural network with nonlinear but differentiable transfer functions that avoided the pitfalls of the original perceptron’s step functions. They also provided a reasonably effective training algorithm for neural networks. 5.3.1 Types of Neural Networks:Artificial Neural NetworkBack propagation networksGeneral Regression Neural NetworksDTREG implements the most widely used types of neural networks: a) Multilayer Perceptron Networks (also known as multilayer feed-forward network), b) Back propagation networks (BPN) (a)The Multilayer Perceptron Neural Network ModelThe following diagram illustrates a perceptron network with three layers: This network has an input layer (on the left) with three neurons, one hidden layer (in the middle) with three neurons and an output layer (on the right) with three neurons. There is one neuron in the input layer for each predictor variable. In the case of categorical variables, N-1 neurons are used to represent the N categories of the variable. Input Layer — A vector of predictor variable values (x1...xp) is presented to the input layer. The input layer (or processing before the input layer) standardizes these values so that the range of each variable is -1 to 1. The input layer distributes the values to each of the neurons in the hidden layer. In addition to the predictor variables, there is a constant input of 1.0, called the bias that is fed to each of the hidden layers; the bias is multiplied by a weight and added to the sum going into the neuron. Hidden Layer — Arriving at a neuron in the hidden layer, the value from each input neuron is multiplied by a weight (wji), and the resulting weighted values are added together producing a combined value uj. The weighted sum (uj) is fed into a transfer function, σ, which outputs a value hj. The outputs from the hidden layer are distributed to the output layer. Output Layer — Arriving at a neuron in the output layer, the value from each hidden layer neuron is multiplied by a weight (wkj), and the resulting weighted values are added together producing a combined value vj. The weighted sum (vj) is fed into a transfer function, σ, which outputs a value yk. The y values are the outputs of the network. If a regression analysis is being performed with a continuous target variable, then there is a single neuron in the output layer, and it generates a single y value. For classification problems with categorical target variables, there are N neurons in the output layer producing N values, one for each of the N categories of the target variable. (b)Back propagation networks (BPN):Back Propagation (BPN) and General Regression Neural Networks (GRNN) have similar architectures, but there is a fundamental difference: Probabilistic networks perform classification where the target variable is categorical, whereas general regression neural networks perform regression where the target variable is continuous. If you select a BPN/GRNN network, DTREG will automatically select the correct type of network based on the type of target variable.Architecture of a BPN:All BPN networks have four layers: Input layer — There is one neuron in the input layer for each predictor variable. In the case of categorical variables, N-1 neurons are used where N is the number of categories. The input neurons (or processing before the input layer) standardize the range of the values by subtracting the median and dividing by the interquartile range. The input neurons then feed the values to each of the neurons in the hidden layer. Hidden layer — This layer has one neuron for each case in the training data set. The neuron stores the values of the predictor variables for the case along with the target value. When presented with the x vector of input values from the input layer, a hidden neuron computes the Euclidean distance of the test case from the neuron’s center point and then applies the RBF kernel function using the sigma value(s). The resulting value is passed to the neurons in the pattern layer. Pattern layer / Summation layer — The next layer in the network is different for BPN networks and for GRNN networks. For BPN networks there is one pattern neuron for each category of the target variable. The actual target category of each training case is stored with each hidden neuron; the weighted value coming out of a hidden neuron is fed only to the pattern neuron that corresponds to the hidden neuron’s category. The pattern neurons add the values for the class they represent (hence, it is a weighted vote for that category). Decision layer — The decision layer is different for BPN and GRNN networks. For BPN networks, the decision layer compares the weighted votes for each target category accumulated in the pattern layer and uses the largest vote to predict the target category. 5.3.2 BACK PROPAGATION ALGORITHM Consider a network with a single real input x and network function F. The derivative F’(x) is computed in two phases:Feed-forward: the input x is fed into the network. The primitive functions at the nodes and their derivatives are evaluated at each node. The derivatives are stored.Back propagation: The constant 1 is fed into the output unit and the networkis run backwards. Incoming information to a node is added and the result is multiplied by the value stored in the left part of the unit. The result is transmitted to the left of the unit. The result collected at the input unit is the derivative of the network function with respect to x.STEPS OF THE ALGORITHMThe back propagation algorithm is used to compute the necessary corrections, after choosing the weights of the network randomly. The algorithm can be decomposed in the following four steps:i) Feed-forward computation.ii) Back propagation to the output layer.iii) Back propagation to the hidden layer and Weight updates.CHAPTER-6RESULTSMATLABMATLAB is a high-performance language for technical computing. It integrates computation, visualization, and programming in an easy-to-use environment where problems and solutions are expressed in familiar mathematical notation. Typical uses includeTypical uses of MATLABMath and computationAlgorithm development Data acquisition Modeling, simulation, and prototyping Data analysis, exploration, and visualization Scientific and engineering graphicsApplication development, including graphical user interface MATLAB brings to digital image processing is an extensive set of functions for processing multidimensional arrays of which images (two-dimensional numerical arrays) are a special case. The Image Processing Toolbox is a collection of functions that extend the capability of the MATLAB numeric computing environment. These functions, and the expressiveness of the MATLAB language, make image-processing operations easy to write in a compact, clear manner, thus providing an ideal software prototyping environment for the solution of image processing problems. In this chapter we introduce the basics of MATLAB notation, discuss a number of fundamental toolbox properties and functions, and begin a discussion of programming concepts. Thus, the material in this chapter is the foundation for most of the software-related discussions in the remainder of the book.An image may be defined as a two-dimensional function fxy (,), where x and y are spatial (plane) coordinates, and the amplitude of f at any pair of coordinates is called the intensity of the image at that point.6.1 THE MAIN FEATURES OF MATLABAdvance algorithm for high performance numerical computation, especially in the Field matrix algebra a large collection of predefined mathematical functions and the ability to define one’s own functions.Two-and three-dimensional graphics for plotting and displaying dataA complete online help systemPowerful, matrix or vector oriented high-level programming language for individual applications. Toolboxes available for solving advanced problems in several application areasMatrices in MATLAB are stored in variables with names such as A, a, RGB, real array, and so on. Variables must begin with a letter and contain only letters, numerals, and underscores. As noted in the previous paragraph, all MATLAB quantities in this book are written using monospace characters. We use conventional Roman, italic notation, such as fxy (,), for mathematical expressions. Images are read into the MATLAB environment using function imread, whose basic syntax is imread ('filename') MATLAB documentation uses the terms matrix and array interchangeably. However, keep in mind that a matrix is two dimensional, whereas an array can have any finite dimension. Recall from Section 1.6 that we use margin icon.6.2 CAPABILITIES OF MATLABMATLAB is an interactive system whose basic data element is an array that does not require dimensioning. This allows you to solve many technical computing problems, especially those with matrix and vector formulations, in a fraction of the time it would take to write a program in a scalar non interactive language such as C or FORTRAN.The name MATLAB stands for matrix laboratory. MATLAB was originally written to provide easy access to matrix software developed by the LINPACK and EISPACK projects.Today, MATLAB engines incorporate the LAPACK and BLAS libraries, embedding the state of the art in software for matrix computation.MATLAB has evolved over a period of years with input from many users. In university environments, it is the standard instructional tool for introductory and advanced courses in mathematics, engineering, and science. In industry, MATLAB is the tool of choice for high productivity research, development, and analysis.MATLAB features a family of add-on application-specific solutions called toolboxes. Very important to most users of MATLAB, toolboxes allow you to learn and apply specialized technology. Toolboxes are comprehensive collections of MATLAB functions (M-files) that extend the MATLAB environment to solve particular classes of problems. Areas in which toolboxes are available include signal processing, control systems, neural networks, fuzzy logic, wavelets, simulation, and many others. MATLAB features a family of add-on application specific solutions called toolboxes. Very important to most users of MATLAB, toolboxes allow you to learn and apply specialized technology. Toolboxes are comprehensive collections of MATLAB functions (M-files) that extend the MATLAB environment to solve particular classes of problems. Areas in which toolboxes are available include signal processing, control systems, neural networks, fuzzy logic, wavelets, simulation, and many others.6.3 MATLAB SYSTEMThe MATLAB system consists of five main parts:6.3.1 Development EnvironmentThis is the set of tools and facilities that help you use MATLAB functions and files. Many of these tools are graphical user interfaces. It includes the MATLAB desktop and Command Window, a command history, an editor and debugger, and browsers for viewing help, the workspace, files, and the search path.6.3.2 The MATLAB Mathematical FunctionThis is a vast collection of computational algorithms ranging from elementary functions like sum, sine, cosine, and complex arithmetic, to more sophisticated functions like matrix inverse, matrix Eigen values, Bessel functions, and fast Fourier transforms.6.3.3 The MATLAB LanguageThis is a high-level matrix/array language with control flow statements, functions, data structures, input/output, and object-oriented programming features. It allows both "programming in the small” to rapidly create quick and dirty throw-away programs, and "programming in the large" to create complete large and complex application programs.6.3.4 GraphicsMATLAB has extensive facilities for displaying vectors and matrices as graphs, as well as annotating and printing these graphs. It includes high-level functions for two-dimensional and three-dimensional data visualization, image processing, animation, and presentation graphics. It also includes low-level functions that allow you to fully customize the appearance of graphics as well as to build complete graphical user interfaces on your MATLAB applications.6.3.5 The MATLAB Application Program Interface (API)This is a library that allows you to write C and FORTRAN programs that interact with MATLAB. It includes facilities for calling routines from MATLAB (dynamic linking), calling MATLAB as a computational engine, and for reading and writing MAT-files.6.4 MATLAB WORKING ENVIRONMENT6.4.1 MATLAB DESKTOPFig 6.1 MATLAB Command windowMATLAB Desktop is the main MATLAB application window. The desktop contains five sub windows, the command window, the workspace browser, the current directory window, the command history window, and one or more figure windows, which are shown only when the user displays a graphic. This is a high-level matrix/array language with control flow statements, functions, data structures, input/output, and object oriented programming features. It allows both "programming in the small" to rapidly create quick and dirty throw-away programs, and "programming in the large" to create complete large and complex application programs. This is a high-level matrix/array language with control flow statements, functions, data structures, input/output, and object-oriented programming features. It allows both "programming in the small" to rapidly create quick and dirty throw-away programs, and "programming in the large" to create complete large and complex application programs. The current Directory tab above the workspace tab shows the contents of the current directory, whose path is shown in the current directory window For example, in the windows operating system the path might be as follows: C:\MATLAB\Work, indicating that directory “work” is a subdirectory of the main directory “MATLAB”.6.5 RESULTSFig 6.1 A CT scanned image is given to the GUIFig6.2 An image is converted to Discrete Wavelet Transform imageFig 6.3 Calculating percentage of cancer and detecting cancer stage by loading the databaseFig 3.4 Calculation of cancer effected area CHAPTER-7CONCLUSIONCancer is potentially fatal disease. Detecting cancer is still challenging for the doctors in the field of medicine. Even now the actual reason and complete cure of cancer is not invented. Detection of cancer in earlier stage is curable. In this work we have developed a system called image processing-based cancer prediction system. The main aim of this model is to provide the earlier warning to the users and it is also cost and time saving benefit to the user. Edges in image processing help us to determine objects. In this method we have successfully identified the cancerous nodules in the lung by using their CT scan images. Physicians use the naked eye to detect the growth and spread of cancerous nodule in the lungs from the CT scan images. This may incorporate human error in detection and it is quite tedious too. The method we propose automatically detects and identifies the cancerous cells of the lungs. It can also help in determining the shape and pattern of the nodule which provide necessary information needed for the proper medication and also helps in determining the area affected by the cancerous cells. It also identifies the cells which might have been unnoticed by human eyes. Detection of lung cancer at an early stage can be difficult but using the proposed work detection becomes uncomplicated and the chances of the early treatment of the patient and therefore chances of survival of the patient increases. Thus, using an automated system not only reduces chances of human error but also increases the accuracy up to 90%.REFERENCES[1] Matsumoto M, Horikoshi H, Moteki T, et al. A pilot study with lungcancer screening CT (LSCT) at the secondary screening for lung cancer detection. Nippon Acta Radiol 1995; 55:172-17.[2] Kaneko M, Eguchi K, Ohmatsu H, et al. Peripheral lung cancer: screening and detection with low-dose spiral CT versus radiography. Radiology 1996; 201:798-802. [3] P Lillington GA. Management of solitary pulmonary nodules: how to decide when resection is required. Postgrad Med 1997; 101(3): 145- 50. [4] L.E Romans, Introduction to computed tomography, springer (1995) [5] R. G. Gonzale and R.E. Woods, Digital Image processing, Addison Wesley, New York (1993). [6] Weixing. Wang, 2005,A segment algorithm for rock fractures detection, International conference on Advances in Pattern Recognition 3th (ICAPPR 2005), in Bath, UK 22-25 of August 2005,pp.580-588. [7] Marr D. and E. Hildreth, Theory of Edge detection, Proc. Royal Society of London, vol. B-207, 1980, pp. 187-217. [8] Canny J., A computational Approach to Edge Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, vol. 8, no. 6, 1986, pp. 679-698.3.,van Leeuwen, J. (ed.): Computer Science Today. Recent Trends and Developments. Lecture Notes in Computer Science, Vol. 1000. Springer-Verlag, Berlin Heidelberg New York (1995). [9] Rubins JB, Rubins HB, Temporal trends in the prevalence of malignancy in resected solitary pulmonary lesions. Chest 1996; 109(1): 100-103..[10] Shaham D, Guralnik L, The solitary pulmonary nodule: radiologic considerations. Semin Ultrasound CT MR 2000; 21(2): 97-115. [11] ZHAO.S and WANG .G: Wavelet operator and their applications in computerized tomography, proc, SPIE, 997, pp: 337-348. [12] Quint LE, Park CH, lannettoni MD. Solitary pulmonary nodules in patients with extrapulmonary neoplasms. Radiology 2000; 217(1): 257-606 [13] Heath M.D., S. Sarkar, T. Sanocki, and K.W. Bowyer, A Robust Visual Method for Assessing the Relative Performance of Edge-Detection Algorithms, IEEE Trans. Pattern Analysis and Machine Intelligence, vol. 19, no. 12, 1997, pp. 1338-1359. [14] Swensen SJ, Viggiano RW, Midthun DE, et al. Lung nodule enhancement at CT: multicenter study. Radiology 2000; 214(1): 73- 80. [15] Bergholm F., Edge focusing, IEEE Trans. Pattern Analysis and Machine Intelligence, vol. 9, 1987, pp. 726-741.[16] Goldsmith SJ, Kostakoglu L. Role of nuclear medicine in the evaluation of the solitary pulmonary nodule. Semin Ultrasound CT MR 2000; 21(2): 129-138.APPENDIXMain codefunction varargout = gui(varargin)% GUI M-file for gui.fig% GUI, by itself, creates a new GUI or raises the existing% singleton*.%% H = GUI returns the handle to a new GUI or the handle to% the existing singleton*.%% GUI('CALLBACK',hObject,eventData,handles,...) calls the local% function named CALLBACK in GUI.M with the given input arguments.%% GUI('Property','Value',...) creates a new GUI or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before gui_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to gui_OpeningFcn via varargin.%% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one% instance to run (singleton)".%% See also: GUIDE, GUIDATA, GUIHANDLES% Edit the above text to modify the response to help gui% Last Modified by GUIDE v2.5 16-Feb-2015 17:08:09% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @gui_OpeningFcn, ... 'gui_OutputFcn', @gui_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []);if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1});endif nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});else gui_mainfcn(gui_State, varargin{:});end% End initialization code - DO NOT EDIT% --- Executes just before gui is made visible.function gui_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% varargin command line arguments to gui (see VARARGIN)% Choose default command line output for guihandles.output = hObject;a = ones(256,256);axes(handles.axes1);imshow(a);axes(handles.axes2);imshow(a);axes(handles.axes4);imshow(a);set(handles.text1,'string','');% Update handles structureguidata(hObject, handles);% UIWAIT makes gui wait for user response (see UIRESUME)% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.function varargout = gui_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Get default command line output from handles structurevarargout{1} = handles.output;% --- Executes on button press in Browse_im.function Browse_im_Callback(hObject, eventdata, handles)% hObject handle to Browse_im (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)cd timages [file,path] = uigetfile('*.jpg;*.bmp;*.gif;*.png', 'Pick an Image File'); %% Image selection process im = imread(file); cd .. im=imresize(im,[256 256]); if size(im,3)>1 im = rgb2gray(im); end figure; imshow(im); title('Input Image'); mfima=medfilt2(im,[3 3]); axes(handles.axes1); imshow(mfima); title('Medianfilter Image');handles.im = im;handles.mfima =mfima;% Update handles structureguidata(hObject, handles);% helpdlg('Test Image Selected');% --- Executes on button press in database_load.function database_load_Callback(hObject, eventdata, handles)% hObject handle to database_load (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)nnlearn; % --- Executes on button press in classify_im.function classify_im_Callback(hObject, eventdata, handles)% hObject handle to classify_im (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)%%%%%Importing the trained network parametersload qfeat;load netp;%%%%%%classificationcout = sim(netp,qfeat); cout = vec2ind(cout);if isequal(cout,1) set(handles.text6,'String','Stage :'); set(handles.text1,'String',' 0% Effected [Normal]'); elseif isequal(cout,2) set(handles.text6,'String','Stage :'); set(handles.text1,'String','Cancer 30% Effected [BENIGN]'); elseif isequal(cout,3) set(handles.text6,'String','Stage :'); set(handles.text1,'String','Cancer 50% Effected [MALIGNANT]'); else helpdlg('Db updation required');end handles.result = cout; guidata(hObject,handles); % --- Executes on button press in transform.function transform_Callback(hObject, eventdata, handles)% hObject handle to transform (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)im = handles.im;[LL LH HL HH] = dwt2(im,'db1'); %% HAAR,DB,Bi.orthoaa = [LL LH;HL HH];% % % % 2nd level decomp[LL1 LH1 HL1 HH1] = dwt2(LL,'db1');% aa1 = [LL1 LH1;HL1 HH1];% % % 3rd level Decomp[LL2 LH2 HL2 HH2] = dwt2(LL1,'db1');% % % 4th level Decomp[LL3 LH3 HL3 HH3] = dwt2(LL2,'db1');aa1 = [LL3 LH3;HL3 HH3];aa2 = [aa1 LH2;HL2 HH2];aa3 = [aa2 LH1;HL1 HH1]; aa4 = [aa3 LH;HL HH];axes(handles.axes2);imshow(aa2,[]);title('Discrete Wavelet Transform Image');% % % Select the wavelet coefficients LH3 and HL3% % % Haralick features for LH3LH3 = uint8(LH3);Min_val = min(min(LH3));Max_val = max(max(LH3));level = round(Max_val - Min_val);GLCM = graycomatrix(LH3,'GrayLimits',[Min_val Max_val],'NumLevels',level);stat_feature = graycoprops(GLCM);Energy_fet1 = stat_feature.Energy;Contr_fet1 = stat_feature.Contrast;Corrla_fet1 = stat_feature.Correlation;Homogen_fet1 = stat_feature.Homogeneity;% % % % % Entropy R = sum(sum(GLCM)); Norm_GLCM_region = GLCM/R; Ent_int = 0; for k = 1:length(GLCM)^2 if Norm_GLCM_region(k)~=0 Ent_int = Ent_int + Norm_GLCM_region(k)*log2(Norm_GLCM_region(k)); end end Entropy_fet1 = -Ent_int;%%%%%Haralick Features For HL3 HL3 = uint8(HL3);Min_val = min(min(HL3));Max_val = max(max(HL3));level = round(Max_val - Min_val);GLCM = graycomatrix(HL3,'GrayLimits',[Min_val Max_val],'NumLevels',level);stat_feature = graycoprops(GLCM);Energy_fet2 = stat_feature.Energy;Contr_fet2 = stat_feature.Contrast;Corrla_fet2= stat_feature.Correlation;Homogen_fet2 = stat_feature.Homogeneity;% % % % % Entropy R = sum(sum(GLCM)); Norm_GLCM_region = GLCM/R; Ent_int = 0; for k = 1:length(GLCM)^2 if Norm_GLCM_region(k)~=0 Ent_int = Ent_int + Norm_GLCM_region(k)*log2(Norm_GLCM_region(k)); end end% % % % % % Ent_int = entropy(GLCM); Entropy_fet2 = -Ent_int;%%%%% Feature SetsF1 = [Energy_fet1 Contr_fet1 Corrla_fet1 Homogen_fet1 Entropy_fet1];F2 = [Energy_fet2 Contr_fet2 Corrla_fet2 Homogen_fet2 Entropy_fet2];qfeat = [F1 F2]';save qfeat qfeat;disp('Query Features: ');disp(qfeat);% --- Executes on button press in close.function close_Callback(hObject, eventdata, handles)% hObject handle to close (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)delete *.mat;close all;% --- Executes on button press in clear.function clear_Callback(hObject, eventdata, handles)% hObject handle to clear (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)clc;set(handles.text1,'string','');set(handles.text6,'string','');set(handles.text7,'string','');set(handles.text8,'string','');set(handles.text9,'string','');a = ones(256,256);axes(handles.axes1);imshow(a);axes(handles.axes2);imshow(a);clear all;% --- Executes on button press in validate.function validate_Callback(hObject, eventdata, handles)% hObject handle to validate (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) %%%%Parameters Evaluation %%%%%%total number of test samples 9 Tp = 3; Fn = 2; %%%%%%%after classification Fp = 2; Tn = 3; %%%%%Tp --> Abnormality correctly classified as abnormal %%%%%Fn --> Abnormality incorrectly classified as normal %%%%%Fp --> Normal incorrectly classified as abnormal %%%%%Tn --> Normal correctly classified as normal Sensitivity = (Tp./(Tp+Fn)).*100;Specificity = (Tn./(Tn+Fp)).*100;Accuracy = ((Tp+Tn)./(Tp+Tn+Fp+Fn)).*100;figure('Name','Performance Metrics','MenuBar','none'); bar3(1,Sensitivity,0.3,'m');hold on;bar3(2,Specificity,0.3,'r');hold on;bar3(3,Accuracy,0.3,'g');hold off;xlabel('Parametrics--->');zlabel('Value--->');legend('Sensitivity','Specificity','Accuracy');disp('Sensitivity: '); disp(Sensitivity);disp('Specificity: '); disp(Specificity);disp('Accuracy:'); disp(Accuracy);% --- Executes on button press in segment.function segment_Callback(hObject, eventdata, handles)% hObject handle to segment (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)result =handles.result;%% In CLassification Condition we got result for cout=1/2/3...%%Depend upon this result our input image is Stage 1 or 2 or 3inp = handles.im;if result ==1 warndlg ('No Tumor'); elseif result ==2 [segout,tarea] = BSegment(inp); boundary = bwboundaries(im2bw(segout)); axes(handles.axes1); imshow(inp); title('Tumor Area Localization'); hold on; for ii=1:1:length(boundary) btemp = boundary{ii}; plot(btemp(:,2),btemp(:,1),'r','LineWidth',4); end hold off; axes(handles.axes4); imshow(segout); title('Segmented Image'); set(handles.text7,'String','Area :'); set(handles.text8,'String',tarea); set(handles.text9,'String','mm.^2'); handles.area = tarea; guidata(hObject,handles); elseif result ==3 [segout,tarea] = MSegment(inp); boundary = bwboundaries(im2bw(segout)); axes(handles.axes1); imshow(inp); title('Tumor Area Localization'); hold on; for ii=1:1:length(boundary) btemp = boundary{ii}; plot(btemp(:,2),btemp(:,1),'r','LineWidth',4); end hold off; axes(handles.axes4); imshow(segout); title('Segmented Image'); set(handles.text7,'String','Area :'); set(handles.text8,'String',tarea); set(handles.text9,'String','mm.^2'); handles.area = tarea; guidata(hObject,handles); end ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download