diabetestalk.net

Diabetic Retinopathy Keras

Applications - Keras Documentation

Applications - Keras Documentation

Keras Applications are deep learning models that are made available alongside pre-trained weights.These models can be used for prediction, feature extraction, and fine-tuning. Weights are downloaded automatically when instantiating a model. They are stored at ~/.keras/models/. All of these architectures (except Xception and MobileNet) are compatible with both TensorFlow and Theano, and upon instantiation the models will be built according to the image data format set in your Keras configuration file at ~/.keras/keras.json. For instance, if you have set image_data_format=channels_last, then any model loaded from this repository will get built according to the TensorFlow data format convention, "Height-Width-Depth". The Xception model is only available for TensorFlow, due to its reliance on SeparableConvolution layers.The MobileNet model is only available for TensorFlow, due to its reliance on DepthwiseConvolution layers. Usage examples for image classification models from keras.applications.resnet50 import ResNet50from keras.preprocessing import imagefrom keras.applications.resnet50 import preprocess_input, decode_predictionsimport numpy as npmodel = ResNet50(weights='imagenet')img_path = 'elephant.jpg'img = image.load_img(img_path, target_size=(224, 224))x = image.img_to_array(img)x = np.expand_dims(x, axis=0)x = preprocess_input(x)preds = model.predict(x)# decode the results into a list of tuples (class, description, probability)# (one such list for each sample in the batch)print('Predicted:', decode_predictions(preds, top=3)[0])# Predicted: [(u'n02504013', u'Indian_elephant', 0.82658225), (u'n01871265', u'tusker', 0.1122357), (u'n02504458', u'African_elephant', 0.061040461)] from keras.applications.vgg16 import VGG16from keras.preprocessing import imagefrom keras.app Continue reading >>

Deep-learning Based, Automated Segmentation Of Macular Edema In Optical Coherence Tomography

Deep-learning Based, Automated Segmentation Of Macular Edema In Optical Coherence Tomography

Deep-learning based, automated segmentation of macular edema in optical coherence tomography 1Department of Ophthalmology, University of Washington, Seattle, Washington, USA 2Department of Ophthalmology, Puget Sound Veteran Affairs, Seattle Washington, USA 4eScience Institute, University of Washington, Seattle, Washington, USA 1Department of Ophthalmology, University of Washington, Seattle, Washington, USA 2Department of Ophthalmology, Puget Sound Veteran Affairs, Seattle Washington, USA 3University of Washington School of Medicine, Seattle, Washington, USA 4eScience Institute, University of Washington, Seattle, Washington, USA Received 2017 May 1; Revised 2017 Jun 17; Accepted 2017 Jun 20. Copyright 2017 Optical Society of America This article has been cited by other articles in PMC. Evaluation of clinical images is essential for diagnosis in many specialties. Therefore the development of computer vision algorithms to help analyze biomedical images will be important. In ophthalmology, optical coherence tomography (OCT) is critical for managing retinal conditions. We developed a convolutional neural network (CNN) that detects intraretinal fluid (IRF) on OCT in a manner indistinguishable from clinicians. Using 1,289 OCT images, the CNN segmented images with a 0.911 cross-validated Dice coefficient, compared with segmentations by experts. Additionally, the agreement between experts and between experts and CNN were similar. Our results reveal that CNN can be trained to perform automated segmentations of clinically relevant image features. OCIS codes: (150.1135) Algorithms, (110.4500) Optical coherence tomography Over the past decade there has been increased interest in deep learning, a promising class of machine learning models that utilizes multiple neural network layers Continue reading >>

Python - Keras Unsymmetrical Data Diabetic Retinopathy Detection - Stack Overflow

Python - Keras Unsymmetrical Data Diabetic Retinopathy Detection - Stack Overflow

Keras unsymmetrical data Diabetic Retinopathy Detection I'm trying to make a predictive model for Diabetic Retinopathy Detection . The competition's trainig dataset includes hy-res images are unsymmetricaly divided in 5 classes: Normal-25807 images-73.48%; Mild-2442 images-6.96%; Moderate-5291 images-15.07%; Severe-873 images-2.48% and Proliferative-708 images - 2.01%.For this purpose I use Keras framework with Theano backend (for CUDA comutations). For image augmentation I used the ImageDataGenerator (the code is below). I've resized images to 299x299 and divided them into 5 folders accordingly their classes: train_datagen=ImageDataGenerator(rescale=1./255, rotation_range=40, zoom_range=0.2, horizontal_flip=True, fill_mode="constant", zca_whitening=True)train_generator=train_datagen.flow_from_directory('data/~huge_data/preprocessed_imgs/', target_size=(299, 299), batch_size=32, class_mode='categorical') At first, just for testing, I desided to use a simple convolutional model: model=Sequential()model.add(Convolution2D(32,3,3, input_shape=(3, 299, 299), activation='relu'))model.add(MaxPooling2D(pool_size=(2, 2)))model.add(Convolution2D(32, 3, 3, activation='relu'))model.add(MaxPooling2D(pool_size=(2, 2)))model.add(Convolution2D(64, 3, 3, activation='relu'))model.add(MaxPooling2D(pool_size=(2, 2)))model.add(Flatten())model.add(Dense(64, activation='relu'))model.add(Dropout(0.5))model.add(Dense(5, activation='softmax'))model.compile(loss='categorical_crossentropy', optimizer='rmsprop', metrics=['accuracy']) In fitting Image generator, I pointed the class_weights in order to fix the asymmetry of data: class_weight ={0: 25807., 1:2442., 2:5291., 3:873., 4:708.}; model.fit_generator(train_generator, samples_per_epoch=2000, nb_epoch=50, verbose=2, callbacks=callbacks_list, c Continue reading >>

Medical Image Analysis With Deep Learningi

Medical Image Analysis With Deep Learningi

Medical Image Analysis with Deep Learning I Analyzing images and videos, and using them in various applications such as self driven cars, drones etc. with underlying deep learning techniques has been the new research frontier. The recent research papers such as A Neural Algorithm of Artistic Style , show how a styles can be transferred from an artist and applied to an image, to create a new image. Other papers such as Generative Adversarial Networks (GAN) and Wasserstein GAN have paved the path to develop models that can learn to create data that is similar to data that we give them. Thus opening up the world to semi-supervised learning and paving the path to a future of unsupervised learning. While these research areas are still on the generic images, our goal is to use these research into medical images to help healthcare. We need to start with some basics. In this article, I start with basics of image processing, basics of medical image format data and visualize some medical data. In the next article I will deep dive into some convolutional neural nets and use them with Keras for predicting lung cancer. There are a variety of image processing libraries, however OpenCV (open computer vision) has become mainstream due to its large community support and availability in C++, java and python. I prefer using opencv using jupyter notebook. Install OpenCV using: pip install opencv-python or install directly from the source from opencv.org Now open your Jupyter notebook and confirm you can import cv2. You will also need numpy and matplotlib to view your plots inside the notebook. Now, lets check if you can open an image and view it on your notebook using the code below. Lets, do something fun such as detecting a face. To detect face we will use an open source xml stump-based Continue reading >>

Diabetic Retinopathy Detection Contest. What We Did Wrong

Diabetic Retinopathy Detection Contest. What We Did Wrong

Diabetic retinopathy detection contest. What we did wrong After watching the awesome video course by Hugo Larochelle on neural nets (more on this in the previous post ) we decided to test our knowledge on some computer vision contest. We looked at Kaggle and the only active competition related to computer vision (except for the digit recognizer contest , for which lots of perfect out-of-the-box solutions exist) was the Diabetic retinopathy detection contest . This was probably quite hard to become our very first project, but nevertheless we decided to try. The team included Karen , Tigran , Hrayr , Narek (1st to 3rd year bachelor students) and me (PhD student). Long story short, we finished at the 82nd place out of 661 participants, and in this post I will describe in details what we did and what mistakes we made. All required files are on these 2 github repositories . We hope this will be interesting for those who just start to play with neural networks. Also we hope to get feedback from experts and other participants. Diabetic retinopathy is a disease when the retina of the eye is damaged due to diabetes. It is one of the leading causes of blindness in the world. The contests aim was to see if computer programs can diagnose the disease automatically from the image of the retina. It seems the winners slightly surpassed the performance of general ophthalmologists. Each eye of the patient can be in one of the 5 levels: from 0 to 4, where 0 corresponds to the healthy state and 4 is the most severe state. Different eyes of the same person can be at different levels (although some contestants managed to leverage the fact that two eyes are not completely independent). Contestants were given 35126 JPEG images of retinas for training (32.5GB), 53576 images for testing (49.6GB Continue reading >>

A Guide To Deep Learning By

A Guide To Deep Learning By

Justin Johnson's Python / NumPy / SciPy / Matplotlib tutorial for Stanford's CS231n Scipy lecture notes - cover commonly used libraries in more details and introduce more advanced topics When you are comfortable with the prerequisites, we suggest four options for studying deep learning. Choose any of them or any combination of them. The number of stars indicates the difficulty. Hugo Larochelle's video course on YouTube. The videos were recorded in 2013 but most of the content is still fresh. The mathematics behind neural networks is explained in detail. Slides and related materials are available. Stanford's CS231n (Convolutional Neural Networks for Visual Recognition) by Fei-Fei Li, Andrej Karpathy and Justin Johnson. The course is focused on image processing, but covers most of the important concepts in deep learning. Videos (2016) and lecture notes are available. Michael Nielsen's online book Neural networks and deep learning is the easiest way to study neural networks. It doesn't cover all important topics, but contains intuitive explanations and code for the basic concepts. Deep learning , a book by Ian Goodfellow, Yoshua Bengio and Aaron Courville, is the most comprehensive resource for studying deep learning. It covers a lot more than all the other courses combined. There are many software frameworks that provide necessary functions, classes and modules for machine learning and for deep learning in particular. We suggest you not use these frameworks at the early stages of studying, instead we suggest you implement the basic algorithms from scratch. Most of the courses describe the maths behind the algorithms in enough detail, so they can be easily implemented. Jupyter notebooks are a convenient way to play with Python code. They are nicely integrated with matplot Continue reading >>

Microsoft Releases Open-source Toolkit To Accelerate Deep Learning

Microsoft Releases Open-source Toolkit To Accelerate Deep Learning

Microsoft releases open-source toolkit to accelerate deep learning The Chesapeake Conservancy is using Microsoft Cognitive Toolkit to define and train a neural network that accelerates the creation of land cover datasets used to monitor restoration and protection initiatives throughout the Chesapeake Bay. Photo credit: Chesapeake Conservancy. A toolkit used across Microsoft to achieve breakthroughs in artificial intelligence is generally available to the public via an open-source license, a team of researchers and software engineers announced today. The 2.0 version of the toolkit is now in full release, said Chris Basoglu , a partner engineering manager at Microsoft. He has played a key role in developing Microsoft Cognitive Toolkit (previously known as CNTK). The full release of Microsoft Cognitive Toolkit 2.0 for use in production-grade and enterprise-grade deep learning workloads includes hundreds of new features incorporated since the beta to streamline the process of deep learning and to ensure the toolkits seamless integration throughout the wider AI ecosystem. New with the full release today is support for Keras , a user-friendly open-source neural network library that is popular with developers working on deep learning applications. Code written for Keras, explained Basoglu, can now take advantage of the performance and speed available from the Cognitive Toolkit without requiring any code change. Toolkit support for Keras is currently in public preview. The Cognitive Toolkit will continue to accelerate training capabilities by supporting the latest versions of NVIDIAs Deep Learning SDK and advanced graphical processing unit (GPU) architectures such as NVIDIA Volta . Since the beta release of the Cognitive Toolkit in October 2016, the technology has been embrace Continue reading >>

The Application Of Deep Learning For Diabetic Retinopathy Prescreening In Research Eye-pacs

The Application Of Deep Learning For Diabetic Retinopathy Prescreening In Research Eye-pacs

The application of deep learning for diabetic retinopathy prescreening in research eye-PACS Siliang Zhang, Huiqun Wu, Veda Murthy, Ximing Wang, Lin Cao, John Schwartz, Jorge Hernandez, Gustavo Rodriguez, Brent J. Liu The Univ. of Southern California (United States) Full access may be available with your subscription Includes PDF, HTML & Video, when available This will count as one of your downloads. You will have access to both the presentation and article (if available). This content is available for download via your institution's subscription. To access this item, please sign in to your personal account. You currently do not have any folders to save your paper to! Create a new folder below. The increasing incidence of diabetes mellitus (DM) in modern society has become a serious issue. DM can also lead to several secondary clinical complications. One of these complications is diabetic retinopathy (DR), which is the leading cause of new cases of blindness for adults in the United States. While DR can be treated if screened and caught early in progression, the only currently effective method to detect symptoms of DR in the eyes of DM patients is through the manual analysis of fundus images. Manual analysis of fundus images is time-consuming for ophthalmologists and can reduce access to DR screening in rural areas. Therefore, effective automatic prescreening tools on a cloud-based platform might be a potential solution to that problem. Recently, deep learning (DL) approaches have been shown to have state-of-the-art performance in image analysis tasks. In this study, we established a research PACS for fundus images to view DICOMized and anonymized fundus images. We prototyped a deep learning engine in the PACS server to perform prescreening classification of uploaded fu Continue reading >>

Salmon Run: November 2016

Salmon Run: November 2016

In my last post, I mentioned that I presented at the Demystifying Deep Learning and Artificial Intelligence event at Oakland. My talk was about using Transfer Learning from and Fine tuning a Deep Convolutional Network (DCNN) trained on ImageNet to classify images in a different domain. The domain I chose was the images of the retina to detect varying stages of Diabetic Retinopathy (DR). The images came from the Diabetic Retinopathy competition on Kaggle. In order to demonstrate the ideas mentioned in the presentation, I trained a few simple networks with a sample (1,000/35,000) of the data provided. My results were nowhere close to the competition winner, who achieved a Kappa score of 0.85 (a metric indicating agreement of predictions with labels), which is better than human performance (0.83 between a General Physicial and an Opthalmologist and 0.72 between an Optometrist and an Opthalmologist according to this forum post ). Although my best model did achieve a Kappa score of 0.75 on my validation set, which puts me at around the 25-26 position on the public leaderboard. The competition winner Benjamin Graham (min-pooling) posted his a description of his algorithm after the competition. One of the things he did was to preprocess the images so they had more uniformity in terms of brightness and shape. This made sense, since the images vary quite a bit along these dimensions, as you can see below. I have been recently playing around with OpenCV , so I figured it would be interesting to apply some of these techniques to preprocess the images so they were more similar to each other. This post describes what I did. I first tried to standardize on the size. As you can see, some images are more rectangular, with more empty space on the left and right, and some are more squar Continue reading >>

Detecting Malicious Requests With Keras & Tensorflow

Detecting Malicious Requests With Keras & Tensorflow

choose from suggestions on the right-side panel publish any web site on the fly in 1-click (bookmarklet) How to grow my audience and develop my traffic? Publishing quality and relevant content you curate on a regular basis will develop your online visibility and traffic. Learn more and get all the tips to boost your topics views Sharing your scoops to your social media accounts is a must to distribute your curated content. Not only will it drive traffic and leads through your content, but it will help show your expertise with your followers. Branding your topics will give more credibility to your content, position you as a professional expert and generate conversions and leads. How to integrate my topics' content to my website? Integrating your curated content to your website or blog will allow you to increase your website visitors engagement, boost SEO and acquire new visitors. By redirecting your social media traffic to your website, Scoop.it will also help you generate more qualified traffic and leads from your curation work. Save time by spreading curation tasks among your team. How can I send a newsletter from my topic? Distributing your curated content through a newsletter is a great way to nurture and engage your email subscribers will developing your traffic and visibility. Creating engaging newsletters with your curated content is really easy. You dont want your Scoop.it page to be public: make it private. You can decide to make it visible only to you or to a restricted audience. We'll suggest content based on your keywords Continue reading >>

Lessons Learned From Running Hundreds Of Kaggle Competitions

Lessons Learned From Running Hundreds Of Kaggle Competitions

We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime. Lessons Learned from Running Hundreds of Kaggle Competitions Lessons Learned from Running Hundreds of Kaggle Competitions At Kaggle, weve run hundreds of machine learning competitions and seen over 80,000 data scientists make submissions. One thing is clear: winning competitions isnt random. Weve learned that certain tools and methodologies work consistently well on different types of problems. Many participants make common mistakes (such as overfitting) that should be actively avoided. Similarly, competition hosts have their own set of pitfalls (such as data leakage). In this talk, Ill share what goes into a winning competition toolkit along with some war stories on what to avoid. Additionally, Ill share what were seeing on the collaborative side of competitions. Our community is showing an increasing amount of collaboration in developing machine learning models and analytic solutions. Ill showcase examples of this and discuss how these types of collaboration will improve how data science is learned and applied. Continue reading >>

Diabetic Retinopathy Winners' Interview: 4th Place, Julian & Daniel

Diabetic Retinopathy Winners' Interview: 4th Place, Julian & Daniel

The Diabetic Retinopathy (DR) competition asked participants to identify different stages of the eye disease in color fundus photographsof the retina. The competition ran from February through July 2015 and the results were outstanding. By automating the early detection of DR, many more individuals will have access to diagnostic tools and treatment. Early detection of DR is key to slowing the disease's progression to blindness. Fourth place finishers, Julian De Wit and Daniel Hammack, share their approach here (including a simple recipe for using ConvNets on a noisy dataset). What was your background prior to entering this challenge? Julian De Wit:I studied software engineering at the Technical University of Delft in the Netherlands.I've always loved to implement complex (machine learing) algorithms.Nowadays I work as a freelancer and mainly do machine learning projects.I use Kaggle to battle-test ideas and try new algorithms and frameworks. Daniel Hammack:I have been involved in the machine learning field for a few years, starting with science fair in High School. I thought machine learning was pretty neat and mostly taught myself using the great resources online these days. Andrew Ng, Geoff Hinton, Steven Boyd, and Michael Collins all deserve a shoutout for having excellent lectures available online for free. Do you have any prior experience or domain knowledge that helped you succeed in this competition? Daniel:I had never done any image processing before, and also not worked with any medical data, so this competition was a great learning experience for me. I have been keeping up with the research on deep learning for computer vision, but I wanted the chance to try that knowledge out on some real data. Julian:I have always been following advances in Neural networks Continue reading >>

Machine Learning For Diabetic Retinopathy Detection

Machine Learning For Diabetic Retinopathy Detection

Machine Learning for Diabetic Retinopathy Detection Machine Learning Researcher & Engineer | Kaggle Master or What can modern networks learn from old algorithms I spent last month intensively competing in a Kaggles "Diabetic Retinopathy Detection" challenge . Joined this 4-month long challenge late, having limited access to GPU, I set my goal to implement fast yet powerful framework I learnt from a series of papers publishedby Andrew Ng , Professor at Stanford and his colleagues Adam Coates , PhD and Professor Honglak Lee . I very much enjoyed the competition and particularly the fact that I was able to confirm effectiveness of the approach and finished on 131st position out of 661 teams having made just few submissions. Diabetic retinopathy is the leading cause of blindness in the working-age population of the developed world. Currently, detecting DR is a time-consuming and manual process that requires a trained clinician to examine and evaluate digital color fundus photographs of the retina. (from the competition description ). The clinical grading process consists of detection certain subtle features, such as microaneurysms, exudates, intra-retinal hemorrhages and sometimes their position relative to each other on images of the eye. OD at presentation with non-proliferative diabetic retinopathy. Thin arrows: hard exudates; Thick arrow: blot intra-retinal hemorrhage; triangle: microaneurysm. Source The competition participants were provided with training and testing sets of high-resolution retina images (37 and 56 thousand respectively) taken under a variety of imaging conditions. A clinician has rated the presence of diabetic retinopathy in each training image on a scale of 0 (no DR) to 4 (proliferative DR). Fundus images indicating the different grades of diabetic Continue reading >>

Microsoft Cognitive Tool Aims At Catalyzing The Ai Process

Microsoft Cognitive Tool Aims At Catalyzing The Ai Process

Microsoft Cognitive Tool aims at catalyzing the AI process RECOMMENDED: Click here to repair Windows problems & optimize system performance Microsoft has been betting big on democratising artificial intelligence and it is for this reason they had earlier announced a framework that would help companies leverage Microsoft Technology and build their own AI systems. Now Microsoft has announced a Microsoft Cognitive Toolkit that is generally available to the public and is open source in nature. Chris Basoglu, a partner Engineer at Microsoft announced , The 2.0 version of the toolkit is now in full release. The release of Microsoft Cognitive Toolkit 2.0 will be used in production-grade and enterprise grade Deep Learning workloads with the ability to add hundreds of features. In simple words, the tool will be able to help build both platforms for the industries and individual products that can be sold. In a nutshell, the Microsoft Cognitive Toolkit is here to expand the AI ecosystem and while doing so enable a platform to build their AI capabilities, The full release will also support Keras which is an open source neural network which is quite popular with developers who are working on deep learning applications. Now since the Cognitive Tool can directly be integrated with the Keras the latter can take advantage of its speed and performance. Furthermore, the Cognitive Tool will also support NVIDIAs Deep Learning SDK and graphical processing unit including the likes of NVIDIA Volta. The beta versions of the Cognitive tool have been successful in training the neural networks to think like a human brain and in fact in most of the cases outperform a human brain. The latest neural network offers 900 times more information than the existing 30-meter resolution datasets without the Continue reading >>

Tensorflow Dev Summit

Tensorflow Dev Summit

Jeff Dean, Rajat Monga, and Megan Kacholia Jeff Dean, Rajat Monga, and Megan Kacholia deliver the keynote address at the inaugural TensorFlow Dev Summit. They discuss: - Progress since TensorFlows open-source launch - TensorFlows thriving open-source community - TensorFlow applications around the world ... and share some exciting announcements! Speed is everything for effective machine learning, and XLA was developed to reduce training and inference time. In this talk, Chris Leary and Todd Wang describe how TensorFlow can make use of XLA, JIT, AOT, and other compilation techniques to minimize execution time and maximize computing resources. Join Dandelion Mane in this talk as they demonstrate all the amazing things you can do with TensorBoard. You'll learn how to visualize your TensorFlow graphs, monitor training performance, and explore how your models represent your data. TensorFlow allows you to define models using both low- as well as high-level abstractions. In this talk, Martin Wicke will introduce Layers, Estimators, and Canned Estimators for defining models, and show the roadmap for their availability in core TensorFlow. Integrating Keras & TensorFlow: The Keras Workflow, Expanded Keras has the goal to make deep learning accessible to everyone, and it's one of the fastest growing machine learning frameworks. Join Francois Chollet, the primary author of Keras, as he demonstrates how Keras can be used in Tensorflow through a video QA example. In this talk, Daniel Visentin from the DeepMind Applied team talks about DeepMind and TensorFlow. He'll explain the importance of choosing a platform, the team's choice to migrate to TensorFlow, and give a number of examples of how DeepMind uses TensorFlow. Join Brett Kuprel, and see how TensorFlow was used by the artificial

More in diabetes