Friday, October 28, 2016

Generic Programming

Generic programming is defined in Musser & Stepanov (1989) as follows,
Generic programming centers around the idea of abstracting from concrete, efficient algorithms to obtain generic algorithms that can be combined with different data representations to produce a wide variety of useful software.
— Musser, David R.; Stepanov, Alexander A., Generic Programming
or, more simply put,

[Generic programming is the process of lifting] algorithms and data structures from concrete examples to their most general and abstract form.
— Bjarne Stroustrup, Evolving a language in and for the real world: C++ 1991-2006
This is achieved by writing algorithms in terms of "types to-be-specified-later".
Generic programming is a characteristic of computer science in general, as opposed to a characteristic of a specific programming language. It deals with algorithms, and can be applied to most languages, with some differences. For example, these "types to-be-specified-later" are called generics in languages such as Java, C#, F#, Objective-C, and Swift; parametric polymorphism in ones such as ML, Scala, Haskell; and templates in languages like C++ and D;
Each language also has its own way of treating these types, with whatever advantages and disadvantages those ways may entail (there is no such thing as perfection).
Below are some more details about, and an example of Generic Programming.



 
References:
https://en.wikipedia.org/wiki/Generic_programming#Generics_in_Java
Image References:
Image 1: https://www.google.com/imgres?imgurl=http%3A%2F%2Fimages.slideplayer.com%2F16%2F5079496%2Fslides%2Fslide_1.jpg&imgrefurl=http%3A%2F%2Fslideplayer.com%2Fslide%2F5079496%2F&docid=9BEYxVSEtYQM1M&tbnid=qlXd3qo9VaSJEM%3A&w=960&h=720&noj=1&bih=875&biw=1637&ved=0ahUKEwjo7Na0qP7PAhUEOyYKHRHvAPcQMwhcKDMwMw&iact=mrc&uact=8
Image 2: https://www.google.com/imgres?imgurl=http%3A%2F%2Fimages.locanto.in%2F1195428230%2FLearn-use-of-Generic-Programming-in-Java-5_5.jpg&imgrefurl=http%3A%2F%2Fghaziabad.locanto.in%2FID_497963856%2FLearn-use-of-Generic-Programming-in-Java-5.html&docid=kKEqqPItgOTJwM&tbnid=Ov6i86DzN9gOJM%3A&w=283&h=178&noj=1&bih=875&biw=1637&ved=0ahUKEwjo7Na0qP7PAhUEOyYKHRHvAPcQMwhgKDcwNw&iact=mrc&uact=8

Friday, October 21, 2016

MRI's to be used in fetal health tests

So far, ultrasounds have been the main tool for fetal health examinations.
Ultrasounds are affordable and easy to transport, but it doesn't generate as much information as an MRI scan, which could potentially measure the volume of specific chemicals in the placenta and in fetal organs.

This method would be especially helpful for prevention purposes, to catch potential malfunctions and/or issues, before they actually pose a threat to the fetus's health. For example, as found by Ellen Grant’s group, "measurements of oxygen absorption rates in the placenta can indicate placental disorders that might endanger the fetus". The timely measurement of these rates could prove to be the determining factor for the survival or not of the fetus, and they cannot be performed using ultrasound scans.

Hence it is very fortunate that MIT's Computer Science and Artificial Intelligence research department was able to generate "a new algorithm for tracking organs through sequences of MRI scans".

Picture1 - Fetal Ultrasound
Picture 2 - Fetal MRI
 Picture 3 - Placental MRI

References:
http://news.mit.edu/2016/algorithm-mri-scans-fetal-health-1021
Image Sources:
1 - https://www.google.com/imgres?imgurl=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2F2%2F2f%2FCRL_Crown_rump_lengh_12_weeks_ecografia_Dr._Wolfgang_Moroder.jpg&imgrefurl=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FUltrasound&docid=6Kozj1SQ0QlfvM&tbnid=gAWPT2uSwNGlCM%3A&w=976&h=735&bih=1039&biw=1070&ved=0ahUKEwi0-PnMme3PAhXLLSYKHRKDBMEQMwgwKAAwAA&iact=mrc&uact=8
2 - https://www.google.com/search?q=MRI+SCan&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjtityome3PAhXHwiYKHR3oC18Q_AUICCgB&biw=1070&bih=1039&dpr=0.9#tbm=isch&q=fetus+mri&imgrc=nLMWN29OmcR9DM%3A
3 - https://www.google.com/search?q=placental+mri&biw=1070&bih=1039&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiRvILxme3PAhXM5iYKHXqeB5wQ_AUIBigB&dpr=0.9#imgrc=_S7UIA0OzgzrDM%3A

Friday, October 14, 2016

Deep Dream by Google

What it is: "A computer vision program created by Google which uses a convolutional neural network to find and enhance patterns in images via algorithmic pareidolia, thus creating a dreamlike hallucinogenic appearance in the deliberately over-processed images"

How it works: 
  • detects patterns in images to enable the automatic classification of these images
  • Like GP(Gennetic programming) programs, it can be trained
  •  once that is done, it can be run in reverse, which facilitates the better understanding of the structure of the neural network.
  • After enough reiterations, imagery will be adjusted so that it results in a form of pareidolia, which is what is used to algorithmically generate psychedelic and surreal image.

Why is this helpful: It invokes the need and possibilities for further study, because its resemblance to LSD- and psilocybin-induced hallucinations "is suggestive of a functional resemblance between artificial neural networks and particular layers of the visual cortex."

Examples of DeepDream images:



Here is a really cool sample of a DeepDream video:
https://www.youtube.com/watch?v=DgPaCWJL7XI

References:
https://en.wikipedia.org/wiki/DeepDream

Image references:

Friday, October 7, 2016

GP - Fitness & Breeding

In my previous previous blog 'An Overview of Genetic Programming', I went over the general idea of genetic programming. In its basis, GP is testing certain smaller programs, determining whether they are "fit" based on a model of natural selection, and then breeding those programs. There are various ways of  breeding/creating new programs from the old one; Let's look at that in more depth:

Reproduction: The computer literally reproduces the program - i.e. creates a duplicate of it - and copies it to the new population.
Crossover: The computer takes two programs(that have passed the fitness test) and creates a new offspring program by recombining randomly chosen parts from those two selected programs.
Mutation: the computer takes an existing 'fit' program randomly, and changes a chosen part of it.
Lastly,
Architecture-altering operations: in this case, the computer chooses an architecture-altering operation from an available list of operations and applies it to one selected program , hence creating the new offspring program for the new population

References:
http://geneticprogramming.com/tutorial/

Image References:
http://previews.123rf.com/images/iqoncept/iqoncept0905/iqoncept090500016/4813642-An-illustration-of-a-DNA-double-helix-with-one-highlighted-in-red-Stock-Illustration.jpg