<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel rdf:about="https://community.wolfram.com">
    <title>Community RSS Feed</title>
    <link>https://community.wolfram.com</link>
    <description>RSS Feed for Wolfram Community showing any discussions tagged with Image Processing with no replies sorted by most viewed.</description>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1383429" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/240312" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/415505" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1135996" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1142221" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1606199" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1137055" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/511375" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/516227" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/193779" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/749947" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/509162" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1730668" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1137429" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1661864" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/401698" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2144200" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1893009" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1184495" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1732766" />
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1383429">
    <title>[WSC18] Using Machine Learning to Diagnose Pneumonia from Chest X Rays</title>
    <link>https://community.wolfram.com/groups/-/m/t/1383429</link>
    <description>![*Add Cool Image][1]&#xD;
#Microsite#&#xD;
https://one.wolframcloud.com/objects/rohit.panse8/pneumoniadiagnosis&#xD;
#Introduction#&#xD;
  Pneumonia is an infection that causes inflammation in one or both of the lungs; it is induced by a variety of organisms: bacteria, viruses, and fungus. Bacterial pneumonia, the more common type,  is caused by bacteria that multiplies in the lungs;  Viral Pneumonia is caused by an array of viruses, the most common one being Influenza.  Although the severity of pneumonia can vary, young children, seniors, and people with a weakened immune system are the most vulnerable.The CDC reports that of the close to 540,000 cases of pneumonia each year, 50,000 people die. Early and proper diagnosis can tremendously decrease  mortality rate. Conventional diagnosis methods like examining patient medical history and symptoms have their shortcomings.  Dutch researchers, who published their findings in the European Respiratory Journal, found that of 140 patients who had their pneumonia diagnosed by x-ray, doctors initially thought only 41 of them had the severe lung infection. Chest X-rays have long been reliable diagnostic tools for pneumonia. Since pneumonia, is an airspace disease, patients&amp;#039; air spaces are filled with bacteria, viruses, pus, and other microorganisms. A diagnosis is determined by infiltrates,  or white spots, present in a chest X-ray. My project uses a convolutional neural network to diagnose the type of pneumonia that a patient has and. Thank you to Daniel Kermany, Daniel Zhang, and Michael Goldbaum for creating and labeling the dataset. Thanks to Paul Timothy Mooney for making the dataset available on Kaggle.&#xD;
        &amp;lt;br /&amp;gt;&#xD;
&amp;lt;br /&amp;gt;&#xD;
        Below is an example of an infiltrate present in a chest X-ray.&#xD;
&#xD;
![enter image description here][2]&#xD;
&amp;lt;br /&amp;gt;&#xD;
Below is an example of how chest X-rays of the three classifications  generally look. Chest X-rays of pneumonia patients are characterized by loss of diaphramatic shadows, and evidence of pulmonary consolidation(an area of the lung that has filled with liquid instead of air).&#xD;
&#xD;
![enter image description here][3]&#xD;
#Diagnosing pneumonia#&#xD;
&#xD;
##Neural Network&#xD;
&#xD;
I used transfer learning to create my neural network. Transfer learning is the process of using a pre-trained model as a starting point as a model for a second task. &#xD;
&#xD;
&amp;gt; &amp;#034;Transfer learning and domain adaptation refer to the situation where&#xD;
&amp;gt; what has been learned in one setting \[Ellipsis] is exploited to&#xD;
&amp;gt; improve generalization in another setting&amp;#034;-(Page 526, Deep Learning,&#xD;
&amp;gt; 2016)&#xD;
&#xD;
I used ResNet 50, an architecture released in 2015 by Microsoft Research Asia; this network was originally trained on 1.2 million images with 1000 classes.  The immense computing power, time resources, and knowledge dedicated to perfect this network made it a great neural network to use for transfer learning. &#xD;
&amp;lt;br /&amp;gt;&#xD;
&amp;lt;br /&amp;gt;&#xD;
Below is an example of the ResNet 50 in action. It correctly predicts that the image is a golden retriever. In addition, I set the program to output the top 10 probabilities of what it thought the image was. &#xD;
&#xD;
   ![enter image description here][4]&#xD;
&#xD;
There are two notable layers in this network: linear layer and softmax layer. First, the Linear Layer maps the features processed by the other layers to the classifications given. Classifications(classes) are the different objects the neural network is trained to recognize. In the standard ResNet&amp;#039;s case the classes are the 1000 different objects that it is trained to recognize. In the case of my project, the classes are a normal, bacterial pneumonia, and viral pneumonia chest X-rays.  Second, the Softmax layer determines the probabilities of what the image is. Above the probabilities of the image are displayed; the class with the highest probabilities is what the Neural Net outputs. &#xD;
&amp;lt;br /&amp;gt;&#xD;
&amp;lt;br /&amp;gt;&#xD;
Below, I remove the Linear and the Softmax layer. These layers are currently configured to recognize 1000 classes; I only need them to recognize 3 classes of images(normal, bacterial pneumonia, viral pneumonia). I will add these two layers later on. &#xD;
![enter image description here][5]&#xD;
&amp;lt;br /&amp;gt;&#xD;
Below, I replaced the &amp;#034;Input&amp;#034; layer to recieve an input of an image of dimensions 512 by 512. I will configure my training images to  be of this size. &#xD;
![enter image description here][6]&#xD;
&amp;lt;br /&amp;gt;&#xD;
I added 3 layers to a new neural net. The above resizedNet will extract features from the dataset. This new neural net that I created will be used to interpret the features and output what it thinks the input image was. The 3 layers that will do this are the &amp;#034;DropoutLayer&amp;#034;, &amp;#034;LinearLayer&amp;#034;,  and &amp;#034;SoftmaxLayer&amp;#034;. The &amp;#034;DropoutLayer&amp;#034; is used to reduce overfitting; this is the tendency of a neural network to become extremely specialized to a limited set of data points. Overfitting is not desirable because it makes the neural network very ineffective on data points outside of the training set. The Linear layer maps the features from the above layers to the 3 classes, and the softmax layer determines the probabilities of the features. Additionally, the output, determining what class the chest X-ray is, is specified. 0 means a normal chest X-ray, 1 means virus pneumonia, 2 means bacterial pneumonia. &#xD;
&amp;lt;br /&amp;gt;&#xD;
![enter image description here][7]&#xD;
&amp;lt;br /&amp;gt;&#xD;
##Data Importing and Formatting&#xD;
I imported the files from their respective folders. The virus and bacterial pneumonia files were in the same formula, so I used a simple separating sort tool organize only images of a certain class to their corresponding variables. &#xD;
&amp;lt;br /&amp;gt;&#xD;
&#xD;
    normalImg = &#xD;
      Import /@ &#xD;
       FileNames[&amp;#034;*.jpeg&amp;#034;, NotebookDirectory[] &amp;lt;&amp;gt; &amp;#034;train\\NORMAL&amp;#034;];&#xD;
    virusImg = &#xD;
      Import /@ &#xD;
       FileNames[&amp;#034;*_virus_*.jpeg&amp;#034;, &#xD;
        NotebookDirectory[] &amp;lt;&amp;gt; &amp;#034;train\\PNEUMONIA&amp;#034;];&#xD;
    bacImg = Import /@ &#xD;
       FileNames[&amp;#034;*_bacteria_*.jpeg&amp;#034;, &#xD;
        NotebookDirectory[] &amp;lt;&amp;gt; &amp;#034;train\\PNEUMONIA&amp;#034;];&#xD;
&amp;lt;br /&amp;gt;&#xD;
I conformed the images to have dimensions of 512 by 512. I did this because I specified the Input layer to take images of only those dimensions. &#xD;
&amp;lt;br /&amp;gt;&#xD;
&#xD;
    normNorm = ConformImages[Import /@ normalFiles, {512, 512}];&#xD;
    virusNorm = ConformImages[Import /@ virusFiles, {512, 512}];&#xD;
    bacNorm = ConformImages[Import /@ bacFiles, {512, 512}];&#xD;
&amp;lt;br /&amp;gt;&#xD;
Below is how conformed images look.&#xD;
&amp;lt;br /&amp;gt;&#xD;
Before:&#xD;
&amp;lt;br /&amp;gt;&#xD;
![enter image description here][8]&#xD;
&amp;lt;br /&amp;gt;&#xD;
After:&#xD;
&amp;lt;br/&amp;gt;&#xD;
![enter image description here][9]&#xD;
&amp;lt;br /&amp;gt;&#xD;
Later, I adjusted the way I conformed my images. I augmented my data set to improve my neural net. By altering the data set, my neural net would become adapted to a greater variety of images. &#xD;
&amp;lt;br /&amp;gt;&#xD;
&#xD;
    normNorm = &#xD;
      ConformImages[&#xD;
       Table[If[RandomReal[] &amp;gt; .8, &#xD;
         If[RandomReal[] &amp;gt; .5, rotateImage[i], shearImage[i]], i], {i, &#xD;
         Import /@ normalFiles}], {512, 512}];&#xD;
    virusNorm = &#xD;
      ConformImages[&#xD;
       Table[If[RandomReal[] &amp;gt; .8, &#xD;
         If[RandomReal[] &amp;gt; .5, rotateImage[i], shearImage[i]], i], {i, &#xD;
         Import /@ virusFiles}], {512, 512}];&#xD;
    bacNorm = &#xD;
      ConformImages[&#xD;
       Table[If[RandomReal[] &amp;gt; .8, &#xD;
         If[RandomReal[] &amp;gt; .5, rotateImage[i], shearImage[i]], i], {i, &#xD;
         Import /@ bacFiles}], {512, 512}];&#xD;
&amp;lt;br /&amp;gt;&#xD;
I made 40% of the images  undergo a rotation via rotateImage, and I made another 40% of the images undergo a perspective transformation via shearImage.&#xD;
&amp;lt;br /&amp;gt;&#xD;
&#xD;
    rotateImage[i_] := ImageRotate[i, RandomReal[{-Pi/27, Pi/27}]];&#xD;
    shearImage[i_] := &#xD;
      ImagePerspectiveTransformation[&#xD;
       i, {{1, RandomReal[{-.25, .25}], 0}, {0, 1, 0}, {0, 0, 1}}];&#xD;
&amp;lt;br /&amp;gt;&#xD;
Below are the images before a rotate and perspective change respectively.&#xD;
![enter image description here][10]&#xD;
&amp;lt;br /&amp;gt;&#xD;
##Preparing Images&#xD;
Above,  two separate neural networks were created. One, the resizedNet, extracts features. The other, the learnNet, would interpret the features and determine the output. By creating two separate neural networks we can preprocess the data instead of having to process the data repeatedly as we would have to in a prematurely combined network. Below, I process the  images to extract features using the resizedNet, a neural network that uses the ResNet 50 framework. &#xD;
&amp;lt;br /&amp;gt;&#xD;
&#xD;
    normalFeats = resizedNet[normNorm, TargetDevice -&amp;gt; &amp;#034;GPU&amp;#034;];&#xD;
    virusFeats = resizedNet[virusNorm, TargetDevice -&amp;gt; &amp;#034;GPU&amp;#034;];&#xD;
    bacFeats = resizedNet[bacNorm, TargetDevice -&amp;gt; &amp;#034;GPU&amp;#034;];&#xD;
&amp;lt;br /&amp;gt;&#xD;
Below, the feature extracted images undergo two processes. First, the images are mapped to certain numerical codes. The normal chest X-rays are mapped to the code 0, the virus chest X-rays are mapped to the code 1, and the bacteria chest X-rays are mapped to the code 2. The images are mapped to codes, so the neural network knows the identity of the images when training the network. In addition, the codes are outputted when the trained network interprets an image to be a certain class. For example if the trained network is given a normal chest X-ray, then it should output the code 0. Second, the processed images are joined into one massive list. &#xD;
&amp;lt;br /&amp;gt;&#xD;
&#xD;
    feats = RandomSample[&#xD;
       Join[Map[# -&amp;gt; 0 &amp;amp;, resizedNet[normNorm, TargetDevice -&amp;gt; &amp;#034;GPU&amp;#034;]], &#xD;
        Map[# -&amp;gt; 1 &amp;amp;, resizedNet[virusNorm, TargetDevice -&amp;gt; &amp;#034;GPU&amp;#034;]], &#xD;
        Map[# -&amp;gt; 2 &amp;amp;, resizedNet[bacNorm, TargetDevice -&amp;gt; &amp;#034;GPU&amp;#034;]]]];&#xD;
&amp;lt;br /&amp;gt;&#xD;
The massive list of processed images are  partitioned into a training set and a test set. The training set will train the network and determine the proper weights needed to recognize the images properly. The test set will be used to check the true progress of the neural network. Since, the neural network is never trained on the test set, it would serve as an objective  indicator of progress when training. &#xD;
&amp;lt;br /&amp;gt;&#xD;
&#xD;
    trainFeat = feats[[1 ;; 5000]];&#xD;
    testFeat = feats[[5000 ;; 5200]];&#xD;
##Training the Neural Net#&#xD;
&amp;lt;br /&amp;gt;&#xD;
The below script was used to train the learnNet with the training data set, trainFeat, and the testing data set. &#xD;
&amp;lt;br /&amp;gt;&#xD;
&#xD;
    trainedNet = &#xD;
     NetTrain[learnNet, trainFeat, ValidationSet -&amp;gt; testFeat, &#xD;
      MaxTrainingRounds -&amp;gt; 35, TargetDevice -&amp;gt; &amp;#034;GPU&amp;#034;]&#xD;
&amp;lt;br /&amp;gt;&#xD;
I trained the neural network 4 separate times each with different settings:&#xD;
&#xD;
 1. Regular data set 35 rounds of training&#xD;
 2. Regular data set 70 rounds of training&#xD;
 3. Augmented data set 35 rounds of training&#xD;
 4. Augmented data set 70 rounds of training&#xD;
&amp;lt;br /&amp;gt;&#xD;
&#xD;
The accuracy results of the neural network are below &#xD;
&#xD;
 1. Regular 35 rounds: about 24.9% error&#xD;
 2. Regular 70 rounds: about 19.9% error&#xD;
 3. Augmented 35 rounds: about 20.9% error&#xD;
 4. Augmented 70 rounds: about 17.4% error&#xD;
&amp;lt;br /&amp;gt;&#xD;
Below is an image loss function and error rate of the Augmented 70 rounds neural net. I used this neural net in the final product. &#xD;
&amp;lt;br /&amp;gt;&#xD;
![enter image description here][11]&#xD;
&amp;lt;br /&amp;gt;&#xD;
The trained neural network was exported for use on the microsite. &#xD;
&amp;lt;br /&amp;gt;&#xD;
&#xD;
        Export[&amp;#034;/pnemonia.wlnet&amp;#034;, combinedNet]&#xD;
&amp;lt;br /&amp;gt;&#xD;
#Determining Location of Pneumonia#&#xD;
&amp;lt;br /&amp;gt;&#xD;
4 separate neural networks were created to determine the location of the pneumonia: leftVirus, rightVirus, leftBacteria, rightBacteria. The left lob images were evaluated in a separate neural network because an image of the left side of the chest when compared to the right side of the chest may appear to have pneumonia; the heart appears very white much like a pulmonary consolidation, a key evidence of pneumonia. Evaluating the lobes separately for each type of pneumonia helped ensure accuracy in location recognition.&#xD;
&amp;lt;br /&amp;gt;&#xD;
##Importing Images&#xD;
&amp;lt;br /&amp;gt;&#xD;
For the pneumonia location detection part of this project a subset of data was created. The right and left lungs are often referred to as lobes. 100 images of left lob normal and right lobe normal each and 100 images of  left lobe virus, right lobe virus, left lobe bacteria, right lobe bacteria pneumonia each were selected to train 4 separate neural nets to help determine location of the pneumonia. &#xD;
&amp;lt;br /&amp;gt;&#xD;
Below are the  statements to import the unedited chest X-rays. &#xD;
&#xD;
        halfNormalImg = &#xD;
          Import /@ &#xD;
           FileNames[Except[&amp;#034;.&amp;#034;] ~~ &amp;#034;*.jpeg&amp;#034;, &#xD;
            NotebookDirectory[] &amp;lt;&amp;gt; &amp;#034;HalfData/NORMAL&amp;#034;];&#xD;
        leftVirusImg = &#xD;
          Import /@ &#xD;
           FileNames[Except[&amp;#034;.&amp;#034;] ~~ &amp;#034;*.jpeg&amp;#034;, &#xD;
            NotebookDirectory[] &amp;lt;&amp;gt; &amp;#034;HalfData/VIRUS/Left_Real&amp;#034;];&#xD;
        rightVirusImg = &#xD;
          Import /@ &#xD;
           FileNames[Except[&amp;#034;.&amp;#034;] ~~ &amp;#034;*.jpeg&amp;#034;, &#xD;
            NotebookDirectory[] &amp;lt;&amp;gt; &amp;#034;HalfData/VIRUS/Right_Real&amp;#034;];&#xD;
        leftBacImg = &#xD;
          Import /@ &#xD;
           FileNames[Except[&amp;#034;.&amp;#034;] ~~ &amp;#034;*.jpeg&amp;#034;, &#xD;
            NotebookDirectory[] &amp;lt;&amp;gt; &amp;#034;HalfData/BACTERIA/Left_Real&amp;#034;];&#xD;
        rightBacImg = &#xD;
          Import /@ &#xD;
           FileNames[Except[&amp;#034;.&amp;#034;] ~~ &amp;#034;*.jpeg&amp;#034;, &#xD;
            NotebookDirectory[] &amp;lt;&amp;gt; &amp;#034;HalfData/BACTERIA/Right_Real&amp;#034;];&#xD;
&amp;lt;br /&amp;gt;&#xD;
##Image Editing Functions#&#xD;
&amp;lt;br /&amp;gt;&#xD;
Below are the functions which were used to edit the images. &amp;#034;widthResize&amp;#034; and &amp;#034;cropFinder&amp;#034; both are used in conjunction to crop the image. The number of black pixels on both sides of an image are found at 5 separate places. The greatest amount of pixels for both side are used to crop the image. This function was useful because it almost always placed the spinal chord in the center, and as a result the images could be correctly separated. &#xD;
&#xD;
       &#xD;
        cropFinder[x_, img_] := &#xD;
         Module[{mid, flatValues, cropLeft, cropRight},&#xD;
          mid = Ceiling[Last[ImageDimensions[img]]/(x)];&#xD;
          flatValues = &#xD;
           Flatten@ImageData[&#xD;
             ImageTake[ColorConvert[img, &amp;#034;Grayscale&amp;#034;], {mid, mid}]];&#xD;
          cropLeft = LengthWhile[flatValues, # &amp;lt; 0.2 &amp;amp;];&#xD;
          cropRight = LengthWhile[Reverse[flatValues], # &amp;lt; 0.2 &amp;amp;];&#xD;
          List[cropLeft, cropRight]&#xD;
          ]&#xD;
     &#xD;
        widthResize[img_] := &#xD;
         Block[{ flatValues, cropLeft, cropRight, meanLeft, meanRight, list1, &#xD;
           list2, list3, list4, list5, resizedImage},&#xD;
          list1 = cropFinder[10, img];&#xD;
          list2 = cropFinder[2, img];&#xD;
          list3 = cropFinder[4, img];&#xD;
          list4 = cropFinder[1.5, img];&#xD;
          list5 = cropFinder[1, img];&#xD;
          meanLeft = meanLeft /. x_ /; x &amp;gt; 300 :&amp;gt; 0;&#xD;
          meanLeft = -(Max[{list1[[1]], list2[[1]], list3[[1]], list4[[1]], &#xD;
               list5[[1]]}]);&#xD;
          meanRight = meanRight /. x_ /; x &amp;gt; 300 :&amp;gt; 0;&#xD;
          meanRight = -((Max[{list1[[2]], list2[[2]], list3[[2]], list4[[2]], &#xD;
                list5[[2]]}]));&#xD;
          resizedImage = ImagePad[img, {{meanLeft, meanRight}, {0, 0}}];&#xD;
          ImageResize[resizedImage, {512, 512}]&#xD;
          ]&#xD;
&amp;lt;br /&amp;gt;&#xD;
![enter image description here][12]&#xD;
&amp;lt;br /&amp;gt;&#xD;
##Image Editing Functions cont.#&#xD;
&amp;lt;br /&amp;gt;&#xD;
The below functions were used to separate the images into halves. If a certain image was in the left lobe virus data set, only the left side was extracted. The respective operations were performed on all of the groups of data. (Note: The chest X-rays display the right side of the chest on the left and the left side of the chest on the right. When I crop the image for the left section it will extract the right side of the image.)&#xD;
&amp;lt;br /&amp;gt;&#xD;
&#xD;
        halfFormat[x_, y_] := &#xD;
          Block[{i} , &#xD;
           Table[ImageCrop[widthResize[x[[i]]], {256, 512}, y], {i, &#xD;
             Length[x]}]];&#xD;
        singleHalfFormat[x_, y_] := ImageCrop[widthResize[x], {256, 512}, y];&#xD;
&amp;lt;br /&amp;gt;&#xD;
![enter image description here][13]&#xD;
&amp;lt;br /&amp;gt;&#xD;
Below was the script that was used to edit the images&#xD;
&amp;lt;br /&amp;gt;&#xD;
        leftNormalNorm = halfFormat[widthResize[halfNormalImg], Left];&#xD;
        rightNormalNorm = halfFormat[widthResize[halfNormalImg], Right];&#xD;
        leftVirusNorm = halfFormat[widthResize[leftVirusImg], Left];&#xD;
        rightVirusNorm = halfFormat[widthResize[rightVirusImg], Right];&#xD;
        leftBacNorm = halfFormat[widthResize[leftBacImg], Left];&#xD;
        rightBacNorm = halfFormat[widthResize[rightBacImg], Right];&#xD;
&amp;lt;br /&amp;gt;&#xD;
##Neural Network&#xD;
&amp;lt;br /&amp;gt;&#xD;
The ResNet 50 was used for transfer learning with a similar set up as the neural network created above. &#xD;
&amp;lt;br /&amp;gt;&#xD;
![enter image description here][14]&#xD;
&amp;lt;br /&amp;gt;&#xD;
A &amp;#034;halfLearnNet&amp;#034; was created with a &amp;#034;DropoutLayer&amp;#034;, &amp;#034;LinearLayer&amp;#034;, &amp;#034;SoftmaxLayer&amp;#034;, and an &amp;#034;Output&amp;#034; of two classes. The outputs  were 0 and 1; 0 means that the chest X-ray given is a normal image(no pneumonia); 1 means that the lung had pneumonia. &#xD;
&amp;lt;br /&amp;gt;&#xD;
![enter image description here][15]&#xD;
&amp;lt;br /&amp;gt;&#xD;
##Preparing Images/Training the Neural Net#&#xD;
&amp;lt;br /&amp;gt;&#xD;
The below sequence of steps were used for the other neural nets (right lobe virus, left lobe bacteria, right lobe bacteria). The trained files were exported for use on the microsite.&#xD;
&#xD;
&amp;lt;br /&amp;gt;&#xD;
![enter image description here][16]&#xD;
&amp;lt;br /&amp;gt;&#xD;
Below are error rates of the location detecting neural networks.&#xD;
&amp;lt;br /&amp;gt;&#xD;
 - Virus Left : about 5% error&#xD;
&amp;lt;br /&amp;gt;&#xD;
 - Virus Right : about 5% error &#xD;
&amp;lt;br /&amp;gt;&#xD;
 - Bacteria Left: about 0% error&#xD;
&amp;lt;br /&amp;gt;&#xD;
 - Bacteria Right: about 15% error&#xD;
&amp;lt;br /&amp;gt;&#xD;
#Creating a MicroSite#&#xD;
&amp;lt;br /&amp;gt;&#xD;
Due to the immense size of my trained neural nets, I needed to create a cloud objects for them.&#xD;
&amp;lt;br /&amp;gt;&#xD;
&#xD;
        bacLeftNet = CloudImport[CloudObject[&amp;#034;bacLeftNet.wlnet&amp;#034;]]&#xD;
        bacRightNet = CloudImport[CloudObject[&amp;#034;bacRightNet.wlnet&amp;#034;]]&#xD;
        virusLeftNet = CloudImport[CloudObject[&amp;#034;virusLeftNet.wlnet&amp;#034;]]&#xD;
        virusRightNet = CloudImport[CloudObject[&amp;#034;virusRightNet.wlnet&amp;#034;]]&#xD;
        CloudImport[CloudObject[&amp;#034;pneumonia.wlnet&amp;#034;]]&#xD;
&amp;lt;br /&amp;gt;&#xD;
I created a function which performed my desired tasks: Determine if the given chest X-ray is normal, bacterial, or virus. If the chest X-ray appeared to have pneumonia, the function outputted an the probability that the pneumonia was in the right lung and the left lung. In addition, the given image was returned  so the user could view. it. &#xD;
&amp;lt;br /&amp;gt;&#xD;
![enter image description here][17]&#xD;
&amp;lt;br /&amp;gt;&#xD;
Below was the code for my microsite.&#xD;
&amp;lt;br /&amp;gt;&#xD;
&#xD;
        CloudDeploy[Delayed@FormPage[{&amp;#034;image&amp;#034; -&amp;gt; &amp;#034;Image&amp;#034;},&#xD;
           tesla[#image] &amp;amp;,&#xD;
           AppearanceRules -&amp;gt; &amp;lt;|&#xD;
             &amp;#034;Title&amp;#034; -&amp;gt; &amp;#034;Machine Learning Pneumonia Diagnosis&amp;#034;, &#xD;
             &amp;#034;Description&amp;#034; -&amp;gt; &#xD;
              &amp;#034;&amp;lt;style&amp;gt;.wolfram-branding&amp;gt;.wolfram-branding-cloud:after{\&#xD;
        background-image: url(http://i.imgur.com/hFuh1YT.png)}&amp;lt;/style&amp;gt;Upload \&#xD;
        a Chest X-Ray to recieve a diagnosis&amp;#034;, &amp;#034;SubmitLabel&amp;#034; -&amp;gt; &amp;#034;Classify&amp;#034;, &#xD;
             &amp;#034;PageTheme&amp;#034; -&amp;gt; &amp;#034;Red&amp;#034;|&amp;gt;], &amp;#034;test3&amp;#034;, Permissions -&amp;gt; &amp;#034;Public&amp;#034;]&#xD;
&amp;lt;br /&amp;gt;&#xD;
If an image is given to the microsite the following is outputted. &#xD;
&amp;lt;br /&amp;gt;&#xD;
![enter image description here][18]&#xD;
#Real World Testing#&#xD;
&amp;lt;br /&amp;gt;&#xD;
Real world testing was performed to simulate a real use case. I took a picture of the screen, like someone would take a picture of an chest X-ray. &#xD;
&amp;lt;br /&amp;gt;&#xD;
![enter image description here][19]&#xD;
&amp;lt;br /&amp;gt;&#xD;
The neural network correctly guessed that the image was an instance of viral pneumonia.&#xD;
&amp;lt;br /&amp;gt;&#xD;
![enter image description here][20]&#xD;
&amp;lt;br /&amp;gt;&#xD;
#Conclusion and Acknowledgement&#xD;
&amp;lt;br /&amp;gt;&#xD;
I created a transfer learning neural networks which successful diagnosed pneumonia with an accuracy of about 83% and accurately detected the location of the pneumonia with an average accuracy of about 93%. Data editing and augmentation procedures and increasing the amount of training rounds helped increase accuracy of diagnoses. I would like to thank my mentor, Michael Kaminsky, for helping guide me. In addition, I would like to thank other mentors including Rick Harrigan, Andrea Griffin, Douglas Smith, and Greg Hurst for helping me. Finally, I would like to thank my parents for encouraging me to pursue my passions and keep learning. &#xD;
#Future Improvements#&#xD;
&#xD;
 - Improving image formatting function to make the current program more compatible with poor quality chest X-Rays. &#xD;
 - Using a similar Neural Network set up except with thermal images to efficiently diagnose pneumonia.&#xD;
 - Further augmenting data to improve accuracy of the neural network. &#xD;
#Citations&#xD;
&#xD;
        https://www.mayoclinic.org/diseases-conditions/pneumonia/symptoms-causes/syc-20354204&#xD;
        https://my.clevelandclinic.org/health/diseases/4471-pneumonia&#xD;
        https://www.hopkinsmedicine.org/healthlibrary/conditions/respiratory_disorders/pneumonia_85,P01321&#xD;
        https://www.kaggle.com/paultimothymooney/chest-xray-pneumonia&#xD;
        https://www.med-ed.virginia.edu/courses/rad/cxr/pathology3chest.html&#xD;
        https://machinelearningmastery.com/transfer-learning-for-deep-learning/&#xD;
        https://www.amazon.com/Deep-Learning-Adaptive-Computation-Machine/dp/0262035618/ref=as_li_ss_tl?ie=UTF8&amp;amp;qid=1505772822&amp;amp;sr=8-1&amp;amp;keywords=deep+learning&amp;amp;linkCode=sl1&amp;amp;tag=inspiredalgor-20&amp;amp;linkId=e16a8bbb28ecba154d225ca5f7efcbed&#xD;
        http://www.cell.com/cell/fulltext/S0092-8674(18)30154-5&#xD;
        https://data.mendeley.com/datasets/rscbjbr9sj/2&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2018-07-13at10.32.21PM.png&amp;amp;userId=1372752&#xD;
  [2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Unt1.jpeg&amp;amp;userId=1372752&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Unt2.jpeg&amp;amp;userId=1372752&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Unt4.jpeg&amp;amp;userId=1372752&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Unt5.jpeg&amp;amp;userId=1372752&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Unt6.jpeg&amp;amp;userId=1372752&#xD;
  [7]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Unt7.jpeg&amp;amp;userId=1372752&#xD;
  [8]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Unt8.jpeg&amp;amp;userId=1372752&#xD;
  [9]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Unt9.jpeg&amp;amp;userId=1372752&#xD;
  [10]: http://community.wolfram.com//c/portal/getImageAttachment?filename=arg2.jpeg&amp;amp;userId=1372752&#xD;
  [11]: http://community.wolfram.com//c/portal/getImageAttachment?filename=arg3.jpeg&amp;amp;userId=1372752&#xD;
  [12]: http://community.wolfram.com//c/portal/getImageAttachment?filename=arg4.jpeg&amp;amp;userId=1372752&#xD;
  [13]: http://community.wolfram.com//c/portal/getImageAttachment?filename=arg5.jpeg&amp;amp;userId=1372752&#xD;
  [14]: http://community.wolfram.com//c/portal/getImageAttachment?filename=arg6.jpeg&amp;amp;userId=1372752&#xD;
  [15]: http://community.wolfram.com//c/portal/getImageAttachment?filename=arg7.jpeg&amp;amp;userId=1372752&#xD;
  [16]: http://community.wolfram.com//c/portal/getImageAttachment?filename=arg8.jpeg&amp;amp;userId=1372752&#xD;
  [17]: http://community.wolfram.com//c/portal/getImageAttachment?filename=arg9.jpeg&amp;amp;userId=1372752&#xD;
  [18]: http://community.wolfram.com//c/portal/getImageAttachment?filename=lol1.jpeg&amp;amp;userId=1372752&#xD;
  [19]: http://community.wolfram.com//c/portal/getImageAttachment?filename=lol2.jpeg&amp;amp;userId=1372752&#xD;
  [20]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2018-07-13at11.11.17PM.png&amp;amp;userId=1372752</description>
    <dc:creator>Rohit Panse</dc:creator>
    <dc:date>2018-07-14T03:48:35Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/240312">
    <title>Can NonlinearModelFit consider the error parameters dependent ?</title>
    <link>https://community.wolfram.com/groups/-/m/t/240312</link>
    <description>Dear All,
I am using NonlinearModelFit to fit data with a function with 4 parameters.
With Marquardt Levenberg Algorithm the errors are considered independent, but in reality errors are dependent each other.
Is there a build in function which  I can use that when I type 
nonlimearmodelfit[&amp;#034;ParameterErrors&amp;#034;] I can obtain an evaluation of the errors that takes into consideration that they are dependent each other?

Many thanks,

Best regards,
Maria</description>
    <dc:creator>Maria Giovanna Dainotti</dc:creator>
    <dc:date>2014-04-21T13:05:46Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/415505">
    <title>Applications up for Wolfram Science Summer School</title>
    <link>https://community.wolfram.com/groups/-/m/t/415505</link>
    <description>Take a look and consider applying to this year&amp;#039;s summer school for doing projects using Wolfram Language&#xD;
&#xD;
https://www.wolframscience.com/summerschool/&#xD;
&#xD;
Most students are in their early 20s but the range has been 14-76.  The Wolfram Science Summer School is about doing projects related to Stephen Wolfram&amp;#039;s &amp;#034;A New Kind of Science&amp;#034; http://www.wolframscience.com/nksonline/toc.html and these projects can be from math, physics, computer science, economics, and other sciences, but also have been from art, music, image processing, architecture, data science, etc..&#xD;
&#xD;
This year there will be a new program for doing technology projects (not just software development, image processing, and data, but also anything related to actual products).  More details coming soon.&#xD;
&#xD;
For reference, here is Abby&amp;#039;s community post from last year&#xD;
http://community.wolfram.com/groups/-/m/t/196111?p_p_auth=ExbZ2bNA</description>
    <dc:creator>Todd Rowland</dc:creator>
    <dc:date>2015-01-02T16:39:39Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1135996">
    <title>[WSS17]  Identification &amp;amp; Graph Structure of Rivers</title>
    <link>https://community.wolfram.com/groups/-/m/t/1135996</link>
    <description>A Road Map for Rivers&#xD;
=================&#xD;
&#xD;
The goal of this project was to identify rivers on maps and satellite images, and to calculate each river&amp;#039;s graph structure.&#xD;
&#xD;
We produced two functions: one will return a highlighting of all the water in a satellite image given a location entity, and the other will return  the graph structure of the water in the related street map image of a given location entity. Both functions start by taking the related street map of a location entity and stripping the image of every color other than one light shade of blue. Let&amp;#039;s use Seoul, South Korea as an example:&#xD;
&#xD;
![enter image description here][1]&#xD;
![enter image description here][2]&#xD;
&#xD;
    waterhighlight[entity_] := &#xD;
      Module[{streetmap, color, r, bluemap, mask, satmap},&#xD;
       streetmap = &#xD;
        RemoveAlphaChannel@&#xD;
         FirstCase[&#xD;
          GeoGraphics[entity, &#xD;
           GeoBackground -&amp;gt; &amp;#034;StreetMap&amp;#034;], _Image, $Failed, Infinity];&#xD;
       satmap = &#xD;
        ImageResize[&#xD;
         RemoveAlphaChannel@&#xD;
          FirstCase[&#xD;
           GeoGraphics[entity, &#xD;
            GeoBackground -&amp;gt; &amp;#034;Satellite&amp;#034;], _Image, $Failed, Infinity], &#xD;
         ImageDimensions[streetmap]];&#xD;
       color = &#xD;
        Apply[List, &#xD;
         ColorConvert[Interpreter[&amp;#034;Color&amp;#034;][&amp;#034;RGB 158 197 226&amp;#034;], &amp;#034;RGB&amp;#034;]];&#xD;
       r = If[ImageColorSpace[streetmap] != &amp;#034;RGB&amp;#034;,&#xD;
         ColorConvert[streetmap, &amp;#034;RGB&amp;#034;], streetmap];&#xD;
       bluemap = &#xD;
        SetAlphaChannel[r, Binarize[r, (Norm[# - color] &amp;lt; .15) &amp;amp;]];&#xD;
       mask = Closing[#, 7] &amp;amp;@FillingTransform@Binarize@bluemap;&#xD;
       HighlightImage[&#xD;
        satmap, {EdgeForm[{Red, AbsoluteThickness[1.5]}], &#xD;
         FaceForm[{Red, Opacity[.2]}], mask}]&#xD;
       ];&#xD;
&#xD;
The first function takes the blue image and uses it as a mask to highlight the related satellite image.&#xD;
&#xD;
![enter image description here][3]&#xD;
![enter image description here][4]&#xD;
&#xD;
    watergraph[entity_] := Module[{streetmap, color, r, bluemap, mask},&#xD;
       streetmap = &#xD;
        RemoveAlphaChannel@&#xD;
         FirstCase[&#xD;
          GeoGraphics[entity, &#xD;
           GeoBackground -&amp;gt; &amp;#034;StreetMap&amp;#034;], _Image, $Failed, Infinity];&#xD;
       color = &#xD;
        Apply[List, &#xD;
         ColorConvert[Interpreter[&amp;#034;Color&amp;#034;][&amp;#034;RGB 158 197 226&amp;#034;], &amp;#034;RGB&amp;#034;]];&#xD;
       r = If[ImageColorSpace[streetmap] != &amp;#034;RGB&amp;#034;,&#xD;
         ColorConvert[streetmap, &amp;#034;RGB&amp;#034;], streetmap];&#xD;
       bluemap = &#xD;
        SetAlphaChannel[r, Binarize[r, (Norm[# - color] &amp;lt; .15) &amp;amp;]];&#xD;
       mask = Closing[#, 7] &amp;amp;@FillingTransform@Binarize@bluemap;&#xD;
       MorphologicalGraph@SkeletonTransform[mask]&#xD;
       ];&#xD;
&#xD;
The second function smooths out the blue image, takes it&amp;#039;s skeleton, and uses that to calculate the graph structure. The end product really is a graph object, so one could play with it using Wolfram&amp;#039;s graph functionality to get some interesting results.&#xD;
&#xD;
![enter image description here][5]&#xD;
![enter image description here][6]&#xD;
&#xD;
&#xD;
Since one of the original goals of the project was to identify whether or not an image contained a river, we did make an attempt. We tried to first cut up the satellite images, binarize them, and then sort the tiny images based on the percentage of black and white pixels. We did this because in a large number of the initial images we saw, the water was usually much darker than the surrounding area. However as we looked at more test cases, this method of classifying images became useless. Many pictures require different binarize thresholds, some rivers are actually lighter than their surroundings, they may even be indistinguishable from the background, cloud coverage either blocks the water or can even create dark spots on its own via shadows, rivers may appear too thin to be recognized as such, and so on. As the list of issues grew, we decided to use the street maps due to their reliability. The street maps may have gaps in the water due to bridges, but this can be largely solved with basic image processing.&#xD;
&#xD;
In the future, we would like to implement a random river generation function and find a way to accurately automate the classification of satellite images as: &amp;#034;river&amp;#034; or &amp;#034;not river&amp;#034; to make a training set. From there, you could probably train a neural network to identify rivers from satellite images. &#xD;
&#xD;
[Github][7]&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=10658streetmap.png&amp;amp;userId=1081910&#xD;
  [2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=bluemap.png&amp;amp;userId=1081910&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=satellite.png&amp;amp;userId=1081910&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Highlighted.png&amp;amp;userId=1081910&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Skeleton.png&amp;amp;userId=1081910&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=9925Graphstructure.png&amp;amp;userId=1081910&#xD;
  [7]: https://github.com/Mathfig</description>
    <dc:creator>Z D</dc:creator>
    <dc:date>2017-07-05T19:22:36Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1142221">
    <title>[WSC17] Automated Building Identification from Satellite Imagery</title>
    <link>https://community.wolfram.com/groups/-/m/t/1142221</link>
    <description>## Introduction ##&#xD;
&#xD;
&#xD;
----------&#xD;
Hi, I`m Anish Mahendran, and the goal of my project was to create an automated system to identify buildings from Satellite Imagery. This task was accomplished primarily using machine learning through convolution neural networks. The final result was a program which takes an input satellite image, and highlights all of the buildings within the image by segmenting the input image, and classifying each segmented region as either &amp;#034;contains a building&amp;#034; or &amp;#034;does not contain a building,&amp;#034; using the neural network. The specific operation of the neural network and the segmentation algorithm are described below. &#xD;
&#xD;
## Creating and Training the Convolution Neural Network ##&#xD;
&#xD;
&#xD;
----------&#xD;
The first step was to create a Neural Network which could identify a single image as a building or not a building. The structure of this Neural Network is illustrated below:&#xD;
&#xD;
    lenet = NetChain[{&#xD;
       ConvolutionLayer[30, 5], Ramp, PoolingLayer[2, 2],&#xD;
       ConvolutionLayer[60, 5], Ramp, PoolingLayer[2, 2],&#xD;
       FlattenLayer[], 700, Ramp, 2, SoftmaxLayer[]},&#xD;
      &amp;#034;Output&amp;#034; -&amp;gt; NetDecoder[{&amp;#034;Class&amp;#034;, {&amp;#034;Building&amp;#034;, &amp;#034;NotBuilding&amp;#034;}}],&#xD;
      &amp;#034;Input&amp;#034; -&amp;gt; NetEncoder[{&amp;#034;Image&amp;#034;, {100, 100}, &amp;#034;RGB&amp;#034;}]&#xD;
      ] &#xD;
Next, it was necessary to provide this Neural Network with a vast set of training data in order to effectively identify a wide variety of building types, and to differentiate between buildings and visually similar structures such as roads and parking lots. Unfortunately I could not find any repository of satellite images which were classified in this form, so I had to generate this training data myself. In order to do so, the following procedure was used: First, the google maps api was used in order to get satellite images and street view images of different locations.&#xD;
&#xD;
    GetSatImage[x_, y_, zoom_, range_] := &#xD;
      Image[GeoGraphics[GeoPosition[{x, y}], &#xD;
        GeoServer -&amp;gt; \&#xD;
    {&amp;#034;http://mt0.google.com/vt/lyrs=s&amp;amp;x=`2`&amp;amp;y=`3`&amp;amp;z=`1`&amp;#034;}, &#xD;
        GeoRange -&amp;gt; Quantity[range, &amp;#034;Meters&amp;#034;], GeoZoomLevel -&amp;gt; zoom]];&#xD;
    GetStreetImage[x_, y_, zoom_, range_] := &#xD;
      Image[GeoGraphics[GeoPosition[{x, y}], &#xD;
        GeoBackground -&amp;gt; GeoStyling[&amp;#034;StreetMapNoLabels&amp;#034;], &#xD;
        GeoRange -&amp;gt; Quantity[range, &amp;#034;Meters&amp;#034;], GeoZoomLevel -&amp;gt; zoom]];&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
&#xD;
As illustrated in the above example, a building is represented by gray pixels within street view. By binarizing the street view Image and placing it atop the original satellite image, the following image is created.&#xD;
&#xD;
    HighlightImageParts[x_, y_, zoom_, range_] := &#xD;
      Module[{SatImage, StreetImage, B, configured, partioned, values, &#xD;
        data, Replaced, color},&#xD;
       SatImage = GetSatImage[x, y, zoom, range]; &#xD;
       StreetImage = GetStreetImage[x, y, zoom, range];&#xD;
       color = &#xD;
        RGBColor[{0.8705882352941177`, 0.8627450980392157`, &#xD;
          0.8313725490196079`, 1.`}];&#xD;
       Replaced = ColorReplace[StreetImage, color -&amp;gt; Black, 0.01];&#xD;
       B = Binarize[Replaced, 0];&#xD;
       configured = DeleteSmallComponents[ColorNegate[B], 10];&#xD;
       HighlightImage[SatImage, configured]];&#xD;
![enter image description here][3]&#xD;
&#xD;
The street view Images were processed so that only the buildings (represented by gray in the street view image) remained, and the image was subsequently binarized and color-negated so that the buildings were represented by white, and all other components of the image were represented by black. This image was then segmented into 100 pixel by 100 pixel parts, and the mean color of each segment was calculated. If this mean exceeded 0.2, that would indicate an abundance of white pixels,so it must have contained a building. The following function takes in arguments of latitude, longitude, zoom level, and range, and returns a list of image segments followed by their building index (a value of above 0.2 represents the presence of a building). &#xD;
&#xD;
    AutoGenData[x_, y_, zoom_, range_, partSize_] := &#xD;
      Module[{SatImage, StreetImage, B, configured, partioned, values, &#xD;
        data, Replaced, color},&#xD;
       SatImage = GetSatImage[x, y, zoom, range]; &#xD;
       StreetImage = GetStreetImage[x, y, zoom, range];&#xD;
       color = &#xD;
        RGBColor[{0.8705882352941177`, 0.8627450980392157`, &#xD;
            0.8313725490196079`, 1.`}]&#xD;
          Replaced = ColorReplace[StreetImage, color -&amp;gt; Black, 0.01];&#xD;
       B = Binarize[Replaced, 0];&#xD;
       configured = DeleteSmallComponents[ColorNegate[B], 10];&#xD;
       partioned = ImagePartition[configured, partSize];&#xD;
       values = Map[1 - ImageMeasurements[#, &amp;#034;Mean&amp;#034;] &amp;amp;, partioned, {2}];&#xD;
       data = &#xD;
        Thread[Flatten[ImagePartition[SatImage, partSize]] -&amp;gt; &#xD;
          Flatten[values]]];&#xD;
This approach was used in order to generate approximately 8,000 classified images as the training data.&#xD;
&#xD;
## Image Segmentation (Naive Approach) ##&#xD;
The above steps were used in order to generate a Neural Network which was quite effective at differentiating between images that are not buildings, and images that are.&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
Thus, in order to identify all of the buildings within a satellite image, the input image was cut into squares using the Image Partition function, and each part was individually classified.&#xD;
&#xD;
    NeuralNetImageCut[img_Image, partSize_Integer, function_] := &#xD;
      ImageAssemble[&#xD;
       Map[If[function[#] == &amp;#034;Building&amp;#034;, Blend[{#, Red}], #] &amp;amp;, &#xD;
        ImagePartition[img, partSize], {2}]];&#xD;
&#xD;
![enter image description here][5]&#xD;
&#xD;
However, as illustrated in the above examples, this method is not entirely effective. The issue becomes more prevalent when buildings aren`t arranged in linear order (see below)&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
The primary cause of these inaccuracies is not entirely due to the ineffectiveness of the neural net. Instead, it is primarily a result of the ineffectiveness of the segmentation algorithm. Arbitrarily cutting the image in this manner results in many buildings being clipped (for instance, a given segment may just have one corner of a building). The Neural Network functions incredibly well when provided with a &amp;#034;convenient&amp;#034; crop containing the entire building, but when the image is cut in this manner, it is no longer possible to ensure that the Neural Network is provided with such conveniently cropped images. Thus, the following alternative algorithm was used:&#xD;
&#xD;
## Image Segmentation (Interpolation) ##&#xD;
In order to expose the neural network to more orientations, and thus provide the algorithm with more opportunities to correctly identify the building, instead of simply cutting the image into segments, the algorithm would &amp;#034;pan&amp;#034; across the image and stop whenever it noticed something that the neural network would classify as a building. In other words, instead of cutting the image into disjoint parts, the images would have some overlap. This partition was generated using the ImagePartition function along with the secondary argument which specifies an &amp;#034;offset.&amp;#034; The Neural Network was then applied to each resulting image, and the neural network`s certainty in whether or not the input was a building was recorded. The results were then plotted using an array plot.&#xD;
&#xD;
    TempMap[img_Image, function_, partSize_Integer, offset_Integer] := &#xD;
      ArrayPlot@&#xD;
       Rescale@Clip[Rescale[Map[function[#, &amp;#034;Probabilities&amp;#034;][&amp;#034;Building&amp;#034;] &amp;amp;,&#xD;
           ImagePartition[&#xD;
            img, {partSize, partSize}, {offset, offset}], {2}]], {0, .5}];&#xD;
![enter image description here][7]&#xD;
&#xD;
This &amp;#034;temperature map&amp;#034; of probabilities was processed using the interpolation function in order to make the results smooth and continuous. The resulting, interpolated function was then graphed using a density plot:&#xD;
&#xD;
    TempMapDensity[img_Image, function_, partSize_Integer, &#xD;
       offset_Integer] := Module[{data, f, cfInt, cf, xr, yr, tempMap},&#xD;
       data = TempMapData[img, function, partSize, offset];&#xD;
       f = ListInterpolation[data];&#xD;
       cfInt = &#xD;
        Interpolation@&#xD;
         Table[{p, Append[List @@ ColorData[&amp;#034;TemperatureMap&amp;#034;][p], p]}, {p,&#xD;
            0, 1, 0.05}];&#xD;
       cf = RGBColor@*cfInt;&#xD;
       {xr, yr} = Dimensions[data];&#xD;
       tempMap = &#xD;
        Rasterize[&#xD;
         DensityPlot[f[xr + 1 - x, y], {y, 1, yr}, {x, 1, xr}, &#xD;
          ColorFunction -&amp;gt; (cf[#] &amp;amp;), PlotPoints -&amp;gt; 50, &#xD;
          AspectRatio -&amp;gt; Divide @@ Dimensions[data], Frame -&amp;gt; False, &#xD;
          Background -&amp;gt; None, PlotRangePadding -&amp;gt; None, &#xD;
          ImagePadding -&amp;gt; None], Background -&amp;gt; None];&#xD;
       ImageCompose[img, ImageResize[tempMap, ImageDimensions[img]]]];&#xD;
## Sample Results ##&#xD;
 ![enter image description here][8]&#xD;
![enter image description here][9]&#xD;
![enter image description here][10]&#xD;
&#xD;
## Conclusions and Extensions ##&#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
In conclusion, this program was quite effective at identifying buildings from satellite images. However, there are multiple ways that this program could be improved. First, the size of the test data set could be increased dramatically by automating the process of generating test data (one could possibly make a web crawler which scans a large data set of satellite images in order to generate vast amounts of test data). Furthermore, the current program requires the user to specify the partition size and the offset value manually based on the zoom level of the image. It would be interesting to see this process automated so that the program automatically identifies the zoom level of the image. Future iterations of this program should also try to identify the edges of the buildings themselves once they have been localized to a given, so that the user could perform calculations such as identifying their relative sizes. This could possibly be accomplished through an image processing approach, identifying the gradients within the image, or through a machine learning approach, in which the neural network is trained to identify the vertices of the building.&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Capture1.PNG&amp;amp;userId=1140736&#xD;
  [2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Capture.PNG&amp;amp;userId=1140736&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=2366Capture.PNG&amp;amp;userId=1140736&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=6831Capture.PNG&amp;amp;userId=1140736&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=10308Capture.PNG&amp;amp;userId=1140736&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=7765Capture.PNG&amp;amp;userId=1140736&#xD;
  [7]: http://community.wolfram.com//c/portal/getImageAttachment?filename=3855Capture.PNG&amp;amp;userId=1140736&#xD;
  [8]: http://community.wolfram.com//c/portal/getImageAttachment?filename=5064Capture.PNG&amp;amp;userId=1140736&#xD;
  [9]: http://community.wolfram.com//c/portal/getImageAttachment?filename=3666Capture.PNG&amp;amp;userId=1140736&#xD;
  [10]: http://community.wolfram.com//c/portal/getImageAttachment?filename=10365Capture.PNG&amp;amp;userId=1140736</description>
    <dc:creator>Anish Mahendran</dc:creator>
    <dc:date>2017-07-08T18:07:59Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1606199">
    <title>Random Fonts &amp;amp; Similarities in Deformed Shapes</title>
    <link>https://community.wolfram.com/groups/-/m/t/1606199</link>
    <description>**[Open code in Cloud][1] | Download code to Desktop via Attachments Below**&#xD;
&#xD;
--------------------------------------&#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
![enter image description here][3]&#xD;
&#xD;
[@Marco Thiel][at0] pointed me to an interesting project called [The Venice Time Machine][4] (see also a review [video][5] and a [TED talk][6]). The project aims to digitize and algorithmically process a wealth of data packed in ancient manuscripts. Some steps include the following:&#xD;
&#xD;
&amp;gt; **SCANNING**. Paper documents are turned into high-resolution digital images with the help of scanning machines. &#xD;
&#xD;
&amp;gt; **TRANSCRIPTION**. The graphical complexity and diversity of hand-written documents make transcription a daunting task. For the Venice Time Machine, scientists are currently developing novel algorithms that can transform images into probable words. The images are automatically broken down into sub-images that potentially represent words. Each sub-image is compared to other sub-images, and classified according to the shape of word it features. Each time a new word is transcribed, it allows millions of other word transcripts to be recognized in the database. &#xD;
&#xD;
&amp;gt; **TEXT PROCESSING**. The strings of probable words are then turned into possible sentences by a text processor. This step is accomplished by using, among other tools, algorithms inspired by protein structure analysis that can identify recurring patterns.&#xD;
&#xD;
![enter image description here][7]&#xD;
&#xD;
Because words in the manuscripts are mutually compared to identify similar features and ultimately same words - it reminded me of unsupervised learning. I wanted to play a bit with tech built in in Wolfram Language to see some toy examples at work. (Note, a supervised learning version of this was developed by Marco in a cool project [Classifying Japanese characters from the Edo period][8]). &#xD;
&#xD;
To avoid hunting and cleaning real datasets, lets &amp;#034;simulate handwriting&amp;#034; reflecting on randomness of the character shapes. I also like it because it touches upon some art sides of things, relevant to generation of beautiful random fonts. And actually due to ancient writers&amp;#039; (for example monks) skills and attitudes often handwritten characters will differ less than the typed ones we distort here artificially (see image above). It&amp;#039;s a different story of course if we to compare between handwritings of different authors, which is a challenge and what the Venice project envisions ultimately. This becomes even harder if the letters of a handwritten word are seamlessly connected.&#xD;
&#xD;
I deal with single characters, not words. Let&amp;#039;s define a function that makes an image from a letter:&#xD;
&#xD;
    raster[s_]:=ImagePad[ImageCrop[Rasterize[s,ImageSize-&amp;gt;150]],50,White]&#xD;
&#xD;
I padded it to give enough room for random distortions we will apply. Next function looks convoluted, but it is just a transformation formula that sends sin and cos waves over the letters to distort the shapes (think of your reflection in the water of a pond when you drop a stone there).&#xD;
&#xD;
    transf[rn_,amp_,fre_]:= #+{&#xD;
    	amp Sin[rn[[1]]+fre(#[[1]]+#[[2]])]+amp Cos[rn[[2]]+fre(#[[1]]-#[[2]])],&#xD;
    	amp Cos[rn[[1]]-fre(#[[1]]-#[[2]])]-amp Sin[rn[[2]]-fre(#[[1]]+#[[2]])]}&amp;amp;&#xD;
&#xD;
The next function actually applies a random transformation to a letter image:&#xD;
&#xD;
    randTransf[amp_,fre_][i_]:=&#xD;
        With[{rn=RandomInteger[99,2]},ImageTransformation[i,transf[rn,amp,fre]]]&#xD;
&#xD;
Trying this in action for the letters of the word WOLFRAM and &amp;#034;Felipa&amp;#034; font:&#xD;
&#xD;
    set:=ImagePad[#,-50,Red]&amp;amp;/@randTransf[.02,20]/@raster/@&#xD;
    	(Style[#,FontFamily-&amp;gt;&amp;#034;Felipa&amp;#034;]&amp;amp;/@Characters[&amp;#034;WOLFRAM&amp;#034;])&#xD;
    &#xD;
    set//ConformImages//ImageAssemble&#xD;
&#xD;
![enter image description here][9]&#xD;
&#xD;
Trying this twice and finding the difference reveals that different random samples differ quite strongly:&#xD;
&#xD;
    ImageSubtract[set//ConformImages//ImageAssemble,set//ConformImages//ImageAssemble&#xD;
&#xD;
![enter image description here][10]&#xD;
&#xD;
Lets generate 6 different random versions (each per a CPU core of my machine for parallel processing):&#xD;
&#xD;
    data=Flatten[ParallelTable[set,6]];&#xD;
    Thumbnail[#,50,Padding-&amp;gt;None]&amp;amp;/@data&#xD;
&#xD;
![enter image description here][11]&#xD;
&#xD;
While letters look the same, if you pay attention to the details, the smaller features are different, - that reminds me of ink and hands effects on real paper. Now, to the machine learning. Here is Wolfram Language &amp;#034;out of the box&amp;#034; function, FeatureSpacePlot, that uses machine learning to deduce most relevant features of objects and find similar ones demonstrating the similarity in 2D space. Here the closer objects are more similar. It picks the similarity, correctly gathering letters into 7 different groups - each group for each letter in WOLFRAM:&#xD;
&#xD;
    FeatureSpacePlot[data,PlotTheme-&amp;gt;&amp;#034;Frame&amp;#034;]&#xD;
&#xD;
![enter image description here][12]&#xD;
&#xD;
Let&amp;#039;s try now another effect. I will increase the frequency of distortion making letters &amp;#034;fuzzy&amp;#034; (I cannot ignore the artistry of the visual :-) ). Repeated generations will give different small-scale features:&#xD;
&#xD;
    set:=ImagePad[#,-50,Red]&amp;amp;/@randTransf[.05,100]/@raster/@(Characters[&amp;#034;WOLFRAM&amp;#034;])&#xD;
    set&#xD;
&#xD;
![enter image description here][13]&#xD;
&#xD;
While general shape is the same internal details are very different and noisy. Again generating 6 different sets and applying FeatureSpacePlot we are able to group properly:&#xD;
&#xD;
    data=Flatten[ParallelTable[set,6]];&#xD;
    Thumbnail[#,50,Padding-&amp;gt;None]&amp;amp;/@data&#xD;
&#xD;
    FeatureSpacePlot[data, PlotTheme -&amp;gt; &amp;#034;Frame&amp;#034;, PerformanceGoal -&amp;gt; &amp;#034;Quality&amp;#034;]&#xD;
&#xD;
![enter image description here][14]&#xD;
&#xD;
Of course, with more distortion we would need more sophisticated processing to find clusters of similarity. But this was fun to play with. It would be interesting to come up with something that could cluster same letters even between the 2 fonts shown at the top image in this post.&#xD;
&#xD;
 [at0]: https://community.wolfram.com/web/mthiel&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/objects/wolfram-community/Random-Fonts-&amp;amp;-Similarities-in-Deformed-Shapes-by-Vitaliy-Kaurov&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=34qtregadsf.png&amp;amp;userId=11733&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=weraw4qtergafdv.png&amp;amp;userId=11733&#xD;
  [4]: http://timemachine.eu/&#xD;
  [5]: https://vtm.epfl.ch/page-110486-en-html/&#xD;
  [6]: https://www.youtube.com/watch?v=b6nfoE9ly90&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2019-02-05at4.59.26AM.jpg&amp;amp;userId=11733&#xD;
  [8]: https://community.wolfram.com/groups/-/m/t/1221098&#xD;
  [9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=34qtregadsf.png&amp;amp;userId=11733&#xD;
  [10]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ert43q5etrsbdvzs.png&amp;amp;userId=11733&#xD;
  [11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=sfaawereg.png&amp;amp;userId=11733&#xD;
  [12]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ertgf34.png&amp;amp;userId=11733&#xD;
  [13]: https://community.wolfram.com//c/portal/getImageAttachment?filename=weraw4qtergafdv.png&amp;amp;userId=11733&#xD;
  [14]: https://community.wolfram.com//c/portal/getImageAttachment?filename=sdf3q4tergafsdhng.png&amp;amp;userId=11733</description>
    <dc:creator>Vitaliy Kaurov</dc:creator>
    <dc:date>2019-02-05T12:24:26Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1137055">
    <title>[WSS17] Instance Segmentation Using Neural Network</title>
    <link>https://community.wolfram.com/groups/-/m/t/1137055</link>
    <description>## Introduction&#xD;
**Instance Segmentation** is one of many interesting computer vision tasks that combines **object detection** and **semantic segmentation**. It detects the object, and at the same time, generates a segmentation mask, which you can think as classifying each pixel - whether it belongs to an object or not. &#xD;
&#xD;
Therefore, solving object detection and semantic segmentation together is a good approach to solve instance segmentation. In the summer school, we borrowed the framework of Mask R-CNN, to combine object detection and semantic segmentation in one pipeline, and produced some promising results.&#xD;
&#xD;
Mask R-CNN is developed like this: R-CNN -&amp;gt; Fast R-CNN -&amp;gt; Faster R-CNN -&amp;gt; Mask RCNN. In each stage, researchers solved some bottleneck problems to get faster and better performance. R stands for the region based, so R-CNN a region based convolutional neural network. Mask R-CNN has two stages, the first stage is trying to produce valid bounding box, you can think it as &amp;#034;blobby&amp;#034; image regions because &amp;#034;blobby&amp;#034; regions are likely to contain objects. In the early stage, researchers feed these warped image regions into a convolutional network, and in the output, they put two head, one regression head to produce the bounding-box, another head like SVM to do classify. And peoples kept working on it and make the network more efficient using some tricks like switch the proposal layer and convolutional layer to avoid unnecessary computations. &#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
There is a Github repo [FastMaskRCNN][2], several machine learning enthusiasts are trying to reproduce this paper in Tensorflow. I already obtained &amp;gt;400k epoch weights, but haven&amp;#039;t tested yet, I will keep working on it after summer school. This Mask R-CNN model a too big to finish within 2 weeks, especially since I am new to the TensorFlow framework. Here is the graph visualization from TensorBoard, which looks really complicated and I haven&amp;#039;t figure out the pipeline yet. &#xD;
![enter image description here][3]&#xD;
&#xD;
## My Project&#xD;
Because building Mask R-CNN network in Mathematica side turned out to be too complicated to finish before the deadline. So in the last two days of summer school, I did something simpler, but it&amp;#039;s inspired by Mask R-CNN&amp;#039;s framework, which uses the bounding-box region and corresponding mask to train a network to produce a binary mask (pixel-to-pixel). And this process is like semantic segmentation. In order to get this &amp;#034;pixel-to-pixel&amp;#034; trianing dataset, I wrote a script to process 24k [COCO][4] train2014 dataset and to crop the bounding box region based on the annotation `json` file. Here is how information encoded for object instance annotations:&#xD;
&#xD;
    annotation{&#xD;
    &amp;#034;id&amp;#034; : int,&#xD;
    &amp;#034;image_id&amp;#034; : int,&#xD;
    &amp;#034;category_id&amp;#034; : int,&#xD;
    &amp;#034;segmentation&amp;#034; : RLE or [polygon],&#xD;
    &amp;#034;area&amp;#034; : float,&#xD;
    &amp;#034;bbox&amp;#034; : [x,y,width,height],&#xD;
    &amp;#034;iscrowd&amp;#034; : 0 or 1,&#xD;
    }&#xD;
&#xD;
The original annotation `json` data looks like this: &#xD;
&#xD;
    {&amp;#034;area&amp;#034; -&amp;gt; 54653., &#xD;
     &amp;#034;segmentation&amp;#034; -&amp;gt; {{312.29, 562.89, 402.25, 511.49, 400.96, 425.38, &#xD;
        398.39, 372.69, 388.11, 332.85, 318.71, 325.14, 295.58, 305.86, &#xD;
        269.88, 314.86, 258.31, 337.99, 217.19, 321.29, 182.49, 343.13, &#xD;
        141.37, 348.27, 132.37, 358.55, 159.36, 377.83, 116.95, 421.53, &#xD;
        167.07, 499.92, 232.61, 560.32, 300.72, 571.89}}, &amp;#034;iscrowd&amp;#034; -&amp;gt; 0, &#xD;
     &amp;#034;bbox&amp;#034; -&amp;gt; {116.95, 305.86, 285.3, 266.03}, &amp;#034;image_id&amp;#034; -&amp;gt; 480023, &#xD;
     &amp;#034;category_id&amp;#034; -&amp;gt; 58, &amp;#034;id&amp;#034; -&amp;gt; 86}&#xD;
&#xD;
The code is very simple, we just need to do the following things: &#xD;
&#xD;
 - Use the bounding-box  `{{x, y}, {dw, dh}` to trim the image into bounding-box region image.&#xD;
 - Use the list of points (vertices of the polygon (encoding ground truth segmentation mask) ) and bounding-box image dimensions to produce the corresponding mask for the region image.&#xD;
&#xD;
        convertAnnotationBBoxIntoImageCoord[bbox_List, h_]:= Module[&#xD;
        	{x1, y1, dw, dh},&#xD;
        	{x1, y1, dw, dh} = bbox;&#xD;
        	Transpose[{0, h} + {1, -1} Transpose[Partition[{x1, y1, x1 + dw, y1 + dh}, 2]]]&#xD;
        ]&#xD;
        getMask[pts_List, w_, h_]:= Module[&#xD;
        	{vtx},&#xD;
        	vtx = convertAnnotationMask[pts, h];&#xD;
        	Binarize @ Rasterize[Graphics[{White, Polygon@@vtx}, PlotRange-&amp;gt;{{0, w}, {0, h}}, &#xD;
        	Background-&amp;gt;Black],&amp;#034;Image&amp;#034;, ImageSize-&amp;gt;{w, h}]&#xD;
        ]&#xD;
        extractBBoxAndMask[img_, bbox_, segPts_List]:= Module[&#xD;
        	{bboxLocal, w, h, boxRegion, maskRegion},&#xD;
        	{w, h} = ImageDimensions[img];&#xD;
        	bboxLocal = convertAnnotationBBoxIntoImageCoord[bbox, h];&#xD;
        	boxRegion = ImageTrim[img, bboxLocal];&#xD;
        	maskRegion = ImageTrim[getMask[segPts, w, h], bboxLocal];&#xD;
        	{boxRegion, maskRegion}&#xD;
        ]&#xD;
        imgsAndMasks = &#xD;
         extractBBox[imgs[[#]], bboxes[[#]], maskCoord[[#]]] &amp;amp; /@ Range[10]&#xD;
![enter image description here][5]&#xD;
&#xD;
&#xD;
For the network I used to train, I used ENet, which is a very fast and an efficient network. The Mask R-CNN paper used FCN, which is known as standard network to perform semantic segmentation. I also construct this network in Mathematica and I will try it later as well. &#xD;
The ENet architecture is as followings: &#xD;
&#xD;
![enter image description here][6]&#xD;
![enter image description here][7]&#xD;
&#xD;
The output is a 256 * 256 * 2 tensor produced by a softmax layer, so it encoded the mask as the Pr[ this pixel belongs to object]. Therefore, I also need to convert the mask image from {0,1} binary into {1,2} as the class label and save it as `.dat` as training labels. Because I was running out of the time, I just trained with this simple input and output. A better way Etienne suggested is to extract the output from the final convolutional layer of yolo as an input feature to feed in near the output, which I will definitely try soon. &#xD;
&#xD;
I trained my network only for 9 hours on a single Tesla K80 GPU, and already got very promising results.&#xD;
&#xD;
The way my `instanceSegmentation[image, net, detectionThreshold, overlapThreshold]` work is as followings: &#xD;
&#xD;
 1. Use YOLO network as detector to produce labels, bounding-boxes, and probabilities&#xD;
&#xD;
 2. Use bounding-boxes to crop the image object region and feed it to our trained network&#xD;
&#xD;
 3. Take the output tensor, convert it to binaryImages, resize it back to bounding box dimensions by using `ImagePad`.&#xD;
&#xD;
        padRegionMask[trimmedMask_, bboxLocal_, w_, h_]:= Block[&#xD;
        	{x1,y1,x2,y2},&#xD;
        	{{x1,y1},{x2,y2}} = bboxLocal;&#xD;
        	ImagePad[trimmedMask, &#xD;
        		{{x1, w - x2},&#xD;
        		 {y1, h - y2}}]&#xD;
        ]&#xD;
        &#xD;
        instanceSegmentation[img_, ennet_, detectionThreshold_, overlapThreshold_]:= Module[&#xD;
        	{labels, bboxes, probs, masks, coloredMasks, yoloVis, yoloRes, rectangles, centers},&#xD;
        	yoloRes = detection[img, detectionThreshold, overlapThreshold];&#xD;
        	rectangles =  Transpose[yoloRes][[2]];&#xD;
        	{labels, bboxes, probs} = convertYoloResult[yoloRes];&#xD;
        	centers = Mean/@ bboxes;&#xD;
        	masks = produceMask[ennet, img, bboxes];&#xD;
        	coloredMasks = Flatten[{RandomColor[], Opacity[.45], #}&amp;amp;/@ masks];&#xD;
        	yoloVis = Transpose @ MapThread[&#xD;
        		{&#xD;
        			{Darker @ Green,Opacity[0],#2},&#xD;
        			Style[&#xD;
        				Inset[#1&amp;lt;&amp;gt;&amp;#034; \n(&amp;#034;&amp;lt;&amp;gt;ToString@Round[#3, .01]&amp;lt;&amp;gt;&amp;#034;)&amp;#034;, #4, {Center, Center} ],&#xD;
        				FontSize -&amp;gt; Scaled[.03], FontColor -&amp;gt; White, GrayLevel[0,1], Background -&amp;gt; GrayLevel[1,0]&#xD;
        			]&#xD;
        		}&amp;amp;, {labels, rectangles, probs, centers}];&#xD;
        	HighlightImage[img, Join[{coloredMasks,yoloVis}], ImagePadding -&amp;gt; Scaled[.02]]	&#xD;
        ]&#xD;
&#xD;
Ok, here are some results, I only started training today&#xD;
&#xD;
Many cute dogs &#xD;
&#xD;
![dogs][8]&#xD;
&#xD;
Me and my mentor &#xD;
&#xD;
![Me with my mentor ][9]&#xD;
&#xD;
&#xD;
Me and my phone&#xD;
&#xD;
![Me with my phone][10]&#xD;
&#xD;
&#xD;
Me and my coffee&#xD;
&#xD;
![Me with my coffee][11]&#xD;
&#xD;
Me and my handbag&#xD;
&#xD;
![Me with my handbag][12]&#xD;
&#xD;
&#xD;
Me and my classmates and his phone&#xD;
&#xD;
![Me with my classmates with his phone][13]&#xD;
&#xD;
&#xD;
&#xD;
## Some personal reflection&#xD;
I enjoyed the summer school overall. I have been hoping to explore the Tensorflow framework and watch Stanford CS231n class for few months, but I was always very occupied with school&amp;#039;s classes, other projects, lab&amp;#039;s assignments, coding interviews, etc. I finally find some peaceful time to sit down and learn things I had always to learn. And in the process, I am also very amazed by the neural network framework Wolfram people developed. This is a very powerful and user-friendly framework that inherits Wolfram Language&amp;#039;s elegant syntax and interactive property. I still have some questions about this framework and plan to learn more about it. &#xD;
&#xD;
## Future Direction&#xD;
 1. Use FCN to do mask semantic segmentation&#xD;
 2. After obtained Mask R-CNN trained network, deploy it on a server and build an interesting iOS application. &#xD;
 3. Collaborate with Medical school people and apply Mask R-CNN to some medical imaging problems.&#xD;
&#xD;
&#xD;
## Reference&#xD;
&#xD;
 1. Mask R-CNN  &#xD;
     Paper: https://arxiv.org/abs/1703.06870   &#xD;
     Code (under testing): https://github.com/CharlesShang/FastMaskRCNN&#xD;
 2. ENet: https://arxiv.org/abs/1606.02147&#xD;
 3. YOLO2: https://arxiv.org/abs/1506.02640&#xD;
 4. Fully Convolutional Network (FCN): https://people.eecs.berkeley.edu/~jonlong/long_shelhamer_fcn.pdf&#xD;
 5. Project repo: https://github.com/zhuwenzhen/InstanceSegmentation&#xD;
&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Framework.png&amp;amp;userId=524853&#xD;
  [2]: https://github.com/CharlesShang/FastMaskRCNN&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=png.png&amp;amp;userId=524853&#xD;
  [4]: http://mscoco.org/dataset/#download&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2017-07-0515.14.08.png&amp;amp;userId=524853&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Enet.png&amp;amp;userId=524853&#xD;
  [7]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2017-07-0515.22.14.png&amp;amp;userId=524853&#xD;
  [8]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2017-07-0516.02.58.png&amp;amp;userId=524853&#xD;
  [9]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2017-07-0516.20.56.png&amp;amp;userId=524853&#xD;
  [10]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2017-07-0516.20.47.png&amp;amp;userId=524853&#xD;
  [11]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2017-07-0516.21.35.png&amp;amp;userId=524853&#xD;
  [12]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2017-07-0516.25.30.png&amp;amp;userId=524853&#xD;
  [13]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2017-07-0516.25.38.png&amp;amp;userId=524853</description>
    <dc:creator>Wenzhen Zhu</dc:creator>
    <dc:date>2017-07-05T21:17:23Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/511375">
    <title>[Job] Mathematica Software Engineer [Sciton Inc.]</title>
    <link>https://community.wolfram.com/groups/-/m/t/511375</link>
    <description>**Position**: Mathematica Software Engineer at [Sciton Inc.][1]&#xD;
&#xD;
**Location**: Palo Alto, California&#xD;
&#xD;
Job Description&#xD;
---------------&#xD;
&#xD;
Sciton, Inc. is looking for an exceptional Mathematica Software Engineer with an interest in the medical device (aesthetic laser) technology. The right candidate will use their Mathematica knowledge and experience to work with 3D graphics, perform image processing, and develop user interfaces.&#xD;
&#xD;
We are a diverse group of technical engineers who really enjoy working together to create the best products in the laser industry.  Weve got a good thing here and are looking for the right combination of skills and technical experience. We are a mature startup company with the right attitude of working hard (including long hours) and getting recognized and rewarded for your creativity.&#xD;
&#xD;
Specific Duties &amp;amp; Responsibilities&#xD;
----------------------------------&#xD;
&#xD;
Development of multiple applications using Wolfram Mathematica software package, use of graphics, communication with hardware, image processing.&#xD;
&#xD;
Qualifications&#xD;
--------------&#xD;
&#xD;
- Bachelors degree (Electrical Engineering, Computer Science, Mathematics, Physics or related fields) required.&#xD;
- Programming experience&#xD;
- 3 plus years of work with Mathematica.&#xD;
- User interface design experience&#xD;
- Worked in a Medical Device industry&#xD;
- Self starter and/or able to work as a team when needed&#xD;
- Strong oral and written communication skills as well as project management skills&#xD;
- Must be willing to be flexible in job duties and take on added responsibility when necessary&#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
To apply for one of the following positions, please see our [careers page][2] or send us your résumé as an electronic attachment (PDF format or Word preferred) to jobs@sciton.com with the job title in the subject line. Sciton is an equal opportunity employer.&#xD;
&#xD;
&#xD;
  [1]: http://www.sciton.com/&#xD;
  [2]: http://www.sciton.com/company/careers.html</description>
    <dc:creator>Robert Morquecho</dc:creator>
    <dc:date>2015-06-09T22:41:05Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/516227">
    <title>Is this the best programming style for prototyping a ray tracer</title>
    <link>https://community.wolfram.com/groups/-/m/t/516227</link>
    <description>*Vitaliy Kaurov suggested that I cross post this [StackExchange original][1] here.*&#xD;
&#xD;
I am trying out Mathematica as a prototyping tool.  As an initial exercise I have put together a brute force ray tracer, with a view to using Mathematica&amp;#039;s built in probability distribution functions to test out some fancy shaders.  (My starting point was the F# ray tracer available http://code.msdn.microsoft.com/ParExtSamples.)&#xD;
&#xD;
As this is a first attempt at using Mathematica, other than as a fancy calculator, I would welcome some **guidance or critique on whether this coding style is going to be effective**.  (You will detect from the code that I am accustomed to an object-oriented paradigm.)&#xD;
&#xD;
My own observations, in no particular order, are:&#xD;
&#xD;
 1. It&amp;#039;s an enjoyable way to work, as a lot of the busy type definitions and additional syntax required by other languages is not needed here; the code is quite compact and the intention fairly readable (IMHO).&#xD;
 2. I have built the ray tracer from scratch, without using the ***built-in graphics primitives*** as that would defeat the learning purpose of the exercise and I would probably not be able to roll my own shaders.  As a simple example, addition is not defined for RGBColor, for example.&#xD;
 3. Probably as a consequence, the tracer is very slow, even if I use all the 4 kernels that are available to me.  I dare say that the existing code could be speeded up considerably by removing all the type / pattern matching, but the code would be much harder to follow, I think, and certainly much harder to debug.  My approach seems to mean that I cannot take advantage of Compile optimization, so far as I can see.  If I wanted a fast ray tracer I would write it in C++, but I wonder whether there are any **easy optimizations that I have missed** (and that don&amp;#039;t involve mangling what I have to the extent that the prototyping benefits of Mathematica -- easy refactoring -- would be lost).  However, I am surprised that even with 4 kernels, the cpu of this 4-core (8-core, if you count hyperthreading) never maxes out.  For example, is it worth changing some of the `:=` to `=`?  Things would be even slower if I aliased the results by averaging 4 adjacent traces, for example.  **Real time ray tracing** seems out of reach.&#xD;
 4. Ray tracing results in a lot of &amp;#034;corner cases&amp;#034; that are dealt with naturally with **IEEE maths**.  Unfortunately Mathematica does produce +/-Infinity for +/-1/0, for example, so some of the code should really be extended to treat those cases properly.&#xD;
 5. It would be great if Mathematica had more built-in ***vector algebra*** so that I could write the equations defining the objects and the rays involved and getting Mathematica to calculate the ray intersection points that are at the heart of the ray tracer.  As things stand, `Reduce` and `Solve` have not helped me to find better intersection algorithms, producing either nothing at all or something large an unintelligible, depending on how I posed the problem.&#xD;
&#xD;
Anyway, here is what you get after 110s from `raytrace[400, 400, basescene, 6]`:&#xD;
&#xD;
![Here is what you get after 110s from `raytrace[400, 400, basescene, 6]`][2]&#xD;
&#xD;
&#xD;
... and here is the code:&#xD;
&#xD;
&#xD;
		(* Colour helpers *)&#xD;
		black = {0., 0., 0.};&#xD;
		darkgrey = {.25, .25, .25};&#xD;
		grey = {.5, .5, .5};&#xD;
		white = {1., 1., 1.};&#xD;
		background = black;&#xD;
		defaultcolor = black;&#xD;
		&#xD;
		brightness[{r_, g_, b_}] = Mean[{r, g, b}]; &#xD;
		    &#xD;
		scale[k_, c: {r_, g_, b_}] = k * c;&#xD;
		&#xD;
		zero = {0.,0.,0.};&#xD;
		&#xD;
		(* Mainly for reference; pattern matching normally used instead *)&#xD;
		&#xD;
		ray /: start[ray[s_, d_]] = s;&#xD;
		ray /: dir[ray[s_, d_]] = d;&#xD;
		&#xD;
		camera /: pos[camera[p_, l_]] = p;&#xD;
		camera /: lookat[camera[p_, l_]] = l;&#xD;
		camera /: forward[camera[p_, l_]] = Normalize[l - p];&#xD;
		camera /: down[camera[p_, l_]] = {0., -1., 0.};&#xD;
		camera /: right[c : camera[p_, l_]] := 1.5 * Normalize[Cross[forward[c], down[c]]];&#xD;
		camera /: up[c : camera[p_, l_]] := 1.5 * Normalize[Cross[forward[c], right[c]]];&#xD;
		&#xD;
		&#xD;
		light /: pos[light[p_, c_]] = p;&#xD;
		light /: color[light[p_, c_]] = c;&#xD;
		&#xD;
		scene /: things[scene[t_, l_, c_]] = t;&#xD;
		scene /: lights[scene[t_, l_, c_]] = l;&#xD;
		scene /: camera[scene[t_, l_, c_]] = c;&#xD;
		    &#xD;
		surface /: diffuse[surface[d_, s_, re_, ro_]] = d;&#xD;
		surface /: specular[surface[d_, s_, re_, ro_]] = s;&#xD;
		surface /: reflect[surface[d_, s_, re_, ro_]] = re;&#xD;
		surface /: roughness[surface[d_, s_, re_, ro_]] = ro;&#xD;
		&#xD;
		intersection /: thing[intersection[t_, r_, d_]] = t;&#xD;
		intersection /: ray[intersection[t_, r_, d_]] = r;&#xD;
		intersection /: dist[intersection[t_, r_, d_]] = d;&#xD;
		miss = intersection[nothing, ray[zero, zero], Infinity];&#xD;
		&#xD;
		sceneobject /: surface[sceneobject[s_, i_, n_]] = s;&#xD;
		sceneobject /: intersect[sceneobject[s_, i_, n_]] = i;&#xD;
		sceneobject /: normal[sceneobject[s_, i_, n_]] = n;&#xD;
		&#xD;
		sphere /: center[sphere[c_, r_, s_]] = c;&#xD;
		sphere /: radius[sphere[c_, r_, s_]] = r;&#xD;
		sphere /: surface[sphere[c_, r_, s_]] = s;&#xD;
		normal[sphere[center_, _, _], pos_] = Normalize[pos - center];&#xD;
		&#xD;
		plane /: normal[plane[n_, o_, s_]] = n;&#xD;
		plane /: offset[plane[n_, o_, s_]] = o;&#xD;
		plane /: surface[plane[n_, o_, s_]] = s;&#xD;
		normal[plane[n_, _, _], _] = n;&#xD;
		           &#xD;
		(* Axis-aligned bounding box *)&#xD;
		(* TODO: not yet used; integrate into tracer *)&#xD;
		box /: lowerb[box[l_, u_]] := l;&#xD;
		box /: upperb[box[l_, u_]] := u;&#xD;
		&#xD;
		extendby[box[l_, u_], pt_] :=&#xD;
		    box[MapThread[Min, {l, pt}], MapThread[Max, {u, pt}]];&#xD;
		size[box[l_, u_]] :=&#xD;
		    u - l;&#xD;
		majoraxis[b : box[l_, u_]] :=&#xD;
		    Ordering[size[b], -1]; &#xD;
		&#xD;
		&#xD;
		(* TODO: This does not work for cases where dir has 0 compnent as Mathematic returns ComplexInfinity,&#xD;
		   not +/-Infinity for +/-1/0 *)&#xD;
		intersectboxQ[b : box[l_, u_], r : ray[start_, dir_]] :=&#xD;
		    Module[ {tl = (l - start) / dir, tu = (u - start) / dir, tmin, tmax},&#xD;
		        &#xD;
		        (* Swap u[i] and l[i] if dir[i] &amp;lt; 0 to avoid &#xD;
		           erroneous result because 0 == -0 *)&#xD;
		        tmin = Max[MapThread[Min, {tu, tl}]];&#xD;
		        tmax = Min[MapThread[Max, {tu, tl}]];&#xD;
		        Not[tmax &amp;lt; 0 &amp;amp;&amp;amp; tmin &amp;gt; tmax];&#xD;
		    (* Use Not to cover some Infinity comparisons *)&#xD;
		        &#xD;
		    (*  Which[&#xD;
		        tmax &amp;lt; 0, False, (* Intersection at t = tmax, but it&amp;#039;s behind us *)&#xD;
		        tmin &amp;gt; tmax, False, (* No intersection *)&#xD;
		        True, True (* Interesection at t = tmin *)&#xD;
		        ]*)&#xD;
		    ];&#xD;
		&#xD;
		&#xD;
		&#xD;
		intersect[s : sphere[center_, radius_, _], r : ray[start_, dir_], i : intersection[_, _, currentdist_]] :=&#xD;
		    Module[ {eo = center-start, v, dist, disc},&#xD;
		        v = eo.dir;&#xD;
		        dist = If[ v &amp;lt; 0.,&#xD;
		                   0.,&#xD;
		                   disc = radius * radius - (eo.eo - v * v);&#xD;
		                   If[ disc &amp;lt; 0.,&#xD;
		                       0.,&#xD;
		                       v - Sqrt[disc]&#xD;
		                   ]&#xD;
		               ];&#xD;
		        If[ dist == 0. || dist &amp;gt; currentdist,&#xD;
		            i,&#xD;
		            intersection[s, r, dist]&#xD;
		        ]&#xD;
		    ];&#xD;
		&#xD;
		&#xD;
		intersect[p : plane[norm_, offset_, _], r : ray[start_, dir_], i : intersection[_, _, currentdist_]] :=&#xD;
		    Module[ {denom =  norm . dir, candidatedist},&#xD;
		        If[ denom &amp;gt;= 0.,&#xD;
		            i,&#xD;
		            candidatedist = (norm . start + offset) / (-denom);&#xD;
		            If[ candidatedist &amp;gt; currentdist,&#xD;
		                i,&#xD;
		                intersection[p, r, candidatedist]&#xD;
		            ]&#xD;
		        ]&#xD;
		    ];&#xD;
		 &#xD;
		      &#xD;
		testray[ray_, scene_] :=&#xD;
		    dist[Fold[intersect[#2, ray, #1]&amp;amp;, miss, things[scene]]];&#xD;
		&#xD;
		     &#xD;
		traceray[ray_, scene_, depth_, maxdepth_] :=&#xD;
		    shade[Fold[intersect[#2, ray, #1]&amp;amp;, miss, things[scene]], scene, depth, maxdepth];&#xD;
		&#xD;
		&#xD;
		shade[miss, _, _, _] :=&#xD;
		    background;     &#xD;
		shade[intersection[thing_, ray[start_, dir_], dist_], scene_, depth_, maxdepth_] :=&#xD;
		    Module[ {pos = dist * dir + start, n, reflectdir, naturalcolor, reflectedcolor},&#xD;
		        n = normal[thing, pos];&#xD;
		        reflectdir = dir - 2. * n . dir * n;&#xD;
		        naturalcolor = defaultcolor + getnaturalcolor[thing, pos, n, reflectdir, scene];&#xD;
		        reflectedcolor = If[ depth &amp;gt;= maxdepth,&#xD;
		                             grey,&#xD;
		                             getreflectioncolor[thing, pos + (0.001*reflectdir), n, &#xD;
		                                 reflectdir, scene, depth, maxdepth]&#xD;
		                         ];&#xD;
		        naturalcolor + reflectedcolor&#xD;
		    ];&#xD;
		     &#xD;
		getreflectioncolor[thing_, pos_, n_, rd_, scene_, depth_, maxdepth_] :=&#xD;
		    reflect[surface[thing]][pos] *&#xD;
		    traceray[ray[pos, rd], scene, depth + 1, maxdepth];&#xD;
		             &#xD;
		getnaturalcolor[thing_, pos_, n_, rd_, scene_] :=&#xD;
		    Module[ {addlight, normraydir = Normalize[rd], howrough = roughness[surface[thing]]},&#xD;
		        SetAttributes[addlight, Listable];&#xD;
		        addlight[light[p_, c_]] :=&#xD;
		            Module[ {ldis = p - pos, livec, neatisect, isinshadow, illum, lcolor, spec, scolor},&#xD;
		                livec = Normalize[ldis];&#xD;
		                neatisect = testray[ray[pos, livec], scene];&#xD;
		                isinshadow = neatisect &amp;lt;= Norm[ldis];&#xD;
		                If[ isinshadow,&#xD;
		                    defaultcolor,&#xD;
		                    illum = livec . n;&#xD;
		                    lcolor = If[ illum &amp;gt; 0.,&#xD;
		                                 illum * c,&#xD;
		                                 defaultcolor&#xD;
		                             ];&#xD;
		                    spec = livec . normraydir;&#xD;
		                    scolor = If[ spec &amp;gt; 0.,&#xD;
		                                 (spec ^ howrough) * c,&#xD;
		                                 defaultcolor&#xD;
		                             ];&#xD;
		                    diffuse[surface[thing]][pos] * lcolor + specular[surface[thing]][pos] * scolor&#xD;
		                ]&#xD;
		            ];&#xD;
		        defaultcolor + Total[addlight[lights[scene]]]&#xD;
		    ];&#xD;
		         &#xD;
		 &#xD;
		&#xD;
		 raytrace[screenwidth_ : 64, screenheight_ : 64, scene_ : basescene, maxdepth_ : 1] :=&#xD;
		     Module[ {getpoint},&#xD;
		         getpoint[x_, y_, camera_] :=&#xD;
		             With[ {recenterx = (x - screenwidth / 2.) / (2. * screenwidth), &#xD;
		             recentery = -(y - screenheight / 2.) / (2. * screenheight)},&#xD;
		                 Normalize[forward[camera] + recenterx * right[camera] + recentery * up[camera]]&#xD;
		             ];&#xD;
		         Image[ParallelArray[traceray[ray[pos[camera[scene]], getpoint[#2-1, #1-1, camera[scene]]], &#xD;
		             scene, 0, maxdepth]&amp;amp;, {screenheight, screenwidth}]] // AbsoluteTiming&#xD;
		     ];&#xD;
		 &#xD;
		 &#xD;
		 (* Harness *)&#xD;
		 &#xD;
		(* surface diffuse, specular reflect, roughness *)&#xD;
		uniformsurface[diffuse_, specular_, reflect_, roughness_] = surface[diffuse&amp;amp;, specular&amp;amp;, reflect&amp;amp;, roughness];&#xD;
		 &#xD;
		shiny = uniformsurface[white, grey, .7, 250.];&#xD;
		matteshiny = uniformsurface[white, darkgrey, .7, 250.];&#xD;
		&#xD;
		checkerboard =&#xD;
		    surface[&#xD;
		    If[ OddQ[Floor[#[[3]]] + Floor[#[[1]]]],&#xD;
		        white,&#xD;
		        black&#xD;
		    ]&amp;amp;, &#xD;
		    white &amp;amp;, &#xD;
		    If[ OddQ[Floor[#[[3]]] + Floor[#[[1]]]],&#xD;
		        .1,&#xD;
		        .7&#xD;
		    ]&amp;amp;, &#xD;
		    150.];&#xD;
		 &#xD;
		 &#xD;
		 &#xD;
		 basescene = scene[{  &#xD;
		     sphere[{0., 1., -.25}, 1., shiny], &#xD;
		          sphere[{-.5, 1.3, 1.5}, 0.5, matteshiny],&#xD;
		     plane[{0., 1., 0.}, 0., checkerboard]},&#xD;
		      {light[{-2., 2.5, 0.}, {.5,.45,.41}], light[{2.,4.5,2.},{.99,.95,.8}]},&#xD;
		      camera[{2.75, 2.0, 3.75}, {-.6, .5, 0.}]];&#xD;
		      &#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
To illustrate where I am going with this, here is an example of how one could generate a mesh for a more complex object (a polysphere):&#xD;
&#xD;
		polyspherepoints[rad_Real, divs_Integer] :=&#xD;
		    With[ {u = -(Pi/2.), v = -Pi, &#xD;
		      du = Pi/divs, dv = (2.*Pi)/divs},&#xD;
		        rad * &#xD;
		         Flatten[Table[{Cos[du*i + u]*Cos[dv*j + v], Sin[du*i + u], &#xD;
		            Cos[du*i + u]*Sin[dv*j + v]}, {j, 0, divs}, {i, 0, &#xD;
		        divs}], 1]&#xD;
		    ];&#xD;
		&#xD;
		(* Put the polygon vertices in the right order *)&#xD;
		ordervertices[{{a_, b_}, {c_, d_}}] :=&#xD;
		    {a, b, d, c};&#xD;
		&#xD;
		orderverticestotriangeles[{{a_, b_}, {c_, d_}}] :=&#xD;
		{{a, b, d}, {a, c, d}}&#xD;
		&#xD;
		(* Generate a list of (polyspherepoint) vertice numbers, &#xD;
		   partition them cyclically, and then into quads, and associate them&#xD;
		   with Polygons *)&#xD;
		   &#xD;
		polyspheremeshtriangles[rad_Real, divs_Integer] :=&#xD;
		    Normal @ GraphicsComplex[polyspherepoints[rad, divs], &#xD;
		      Map[Polygon, &#xD;
		       Map[orderverticestotriangeles,&#xD;
		         Partition[Partition[Range[(divs+1)^2], divs+1], {2, 2}, 1, 1], {2}], 1]]; &#xD;
		   &#xD;
		polyspheremeshtriangles[rad_Real, divs_Integer] :=&#xD;
		    Normal @ GraphicsComplex[polyspherepoints[rad, divs], &#xD;
		      Map[Polygon, &#xD;
		       Map[orderverticestotriangeles,&#xD;
		         Partition[Partition[Range[(divs+1)^2], divs+1], {2, 2}, 1, 1], {2}], 1]];&#xD;
		         		 &#xD;
&#xD;
(It would have been satisfying to use some of the geometric transform functions built into Mathematica to generate the vertices, but life was too short.)&#xD;
&#xD;
And here is what `Graphics3D @ polyspheremeshtriangles[1., 8]` generates:&#xD;
&#xD;
![PolySphere, of trianges][3]&#xD;
&#xD;
&#xD;
  [1]: http://mathematica.stackexchange.com/questions/48675/is-this-the-most-effective-and-efficient-programming-style-for-prototyping-a-ra&#xD;
  [2]: http://i.stack.imgur.com/AZE08.png&#xD;
  [3]: http://i.stack.imgur.com/RU6dD.png</description>
    <dc:creator>jr p</dc:creator>
    <dc:date>2015-06-20T11:53:40Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/193779">
    <title>Simple Pendulum Experiment using Mathematica&amp;#039;s Image Processing Capability</title>
    <link>https://community.wolfram.com/groups/-/m/t/193779</link>
    <description>We can use the pin notebook to capture the position and time in space of the pendulum.[mcode]pics = {}; Pause[10]; Do[AppendTo[pics, {AbsoluteTime[], CurrentImage[]}];
Pause[0.1], {i, 120}];[/mcode][img]/c/portal/getImageAttachment?filename=PendulumFilm.gif&amp;amp;userId=78214[/img]

All we need is the section of interest of the frames for the experiment, so using the ImageTrim functionality we can just keep the part of the frame that captures the movement of the golf ball.Using image processing functions, we can reduce the image to the components that will be key to obtaining the centroid of the ball.
[mcode]pics2 = ImageTrim[pics[[#, 2]], {{50., 0.}, {305., 85.}}] &amp;amp; /@ 
Range[Length@pics];
Manipulate[DeleteSmallComponents@ChanVeseBinarize[Dilation[Blur[pics2[[i]], 5.5], 2],&amp;#034;TargetColor&amp;#034; -&amp;gt; Yellow], {i, 1, Length@pics, 1}][/mcode][img=width: 321px; height: 222px;]/c/portal/getImageAttachment?filename=Pendulum2Film.gif&amp;amp;userId=78214[/img]
[mcode]Manipulate[
Show[pics2[[i]], Graphics[{Red, PointSize[Large], Point[Mean@ComponentMeasurements[DeleteSmallComponents@ChanVeseBinarize[Dilation[Blur[pics2[[i]], 5.5], 2],&amp;#034;TargetColor&amp;#034; -&amp;gt; Yellow], &amp;#034;Centroid&amp;#034;][[All, 2]]]}]], {i, 1,Length@pics, 1}][/mcode][img=width: 321px; height: 222px;]/c/portal/getImageAttachment?filename=Pendulum3Film.gif&amp;amp;userId=78214[/img]

times will be used to hold the amounts of seconds that have passed sinced we captured the first frame, positions will be holds the centroid location in pixels.
[mcode]firstFrame = pics[[1, 1]]; 
times = 
pics[[All, 1]] - firstFrame; 
positions = Mean@ComponentMeasurements[DeleteSmallComponents@ChanVeseBinarize[pics2[[#]], &amp;#034;TargetColor&amp;#034; -&amp;gt; Yellow], &amp;#034;Centroid&amp;#034;][[All, 2]] &amp;amp; /@ Range[Length@pics];
[/mcode]Let&amp;#039;s graph the horizontal position of the ball based on the lapsed time.
[mcode]ListPlot[Transpose[{times, positions[[All, 1]]}], Joined -&amp;gt; True, 

AxesLabel -&amp;gt; {&amp;#034;Seconds&amp;#034;, &amp;#034;Horizontal Distance\n(pxls)&amp;#034;}][/mcode][img=width: 360px; height: 222px;]/c/portal/getImageAttachment?filename=xAxisPosition.png&amp;amp;userId=78214[/img]
Clearly a periodic function. There are 5 peaks between 0 and 6.3 seconds (2 Pi). The period of the function is around 5.
Let find an equation that fits the calculation.[mcode]sol = FindFit[Transpose[{times, positions[[All, 1]]}], 

  a Cos[b x + c] + d, {{a, 100}, {b, 5}, c, d}, x, MaxIterations -&amp;gt; 1000]
(*{a -&amp;gt; 99.7899, b -&amp;gt; 5.19945, c -&amp;gt; -0.239585, d -&amp;gt; 127.879}*)
Show[ListPlot[Transpose[{times, positions[[All, 1]]}], 
AxesLabel -&amp;gt; {&amp;#034;Seconds&amp;#034;, &amp;#034;Horizontal Distance\n(pxls)&amp;#034;},
PlotStyle -&amp;gt; Red, Joined -&amp;gt; False], 
Plot[a Cos[b x + c] + d /. sol, {x, 0, 17}]]

[/mcode][img=width: 360px; height: 222px;]/c/portal/getImageAttachment?filename=xAxisPositionFit.png&amp;amp;userId=78214[/img]

The equation that fits the bill and the period of the function are:[mcode](a Cos[b x + c] + d) /. sol
(*127.879 + 99.7899 Cos[0.239585 - 5.19945 x]*)
T = 2 \[Pi]/b /. sol
(*1.20843*)[/mcode]
Wikipedia has all the details on the modelling of the simple pendulum experiment.[url=http://en.wikipedia.org/wiki/Simple_pendulum]http://en.wikipedia.org/wiki/Simple_pendulum[/url] which shows that the equation that relates the period with the length of the pendulum is given by.

[img=width: 334px; height: 51px;]http://upload.wikimedia.org/math/5/a/a/5aa04824df4e09c1ae352502bdee9c92.png[/img]
[mcode]Solve[Period == 2 \[Pi] Sqrt[L/g], g]
(*{{g -&amp;gt; (4 L \[Pi]^2)/Period^2}}*)[/mcode]
Our measurement of the length was as follows.
[img=width: 640px; height: 480px;]/c/portal/getImageAttachment?filename=1836photo.JPG&amp;amp;userId=78214[/img]

If we plug the numbers in then we get.
[mcode]g = 4 \[Pi]^2  0.364/T^2
(*9.84047*)[/mcode]

Checking WolframAlpha
[img=width: 552px; height: 259px;]/c/portal/getImageAttachment?filename=gInGa.png&amp;amp;userId=78214[/img]
which is 0.5% error.</description>
    <dc:creator>Diego Zviovich</dc:creator>
    <dc:date>2014-02-01T17:23:49Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/749947">
    <title>Reading and solving Garam puzzles</title>
    <link>https://community.wolfram.com/groups/-/m/t/749947</link>
    <description>The Reddit math forum [turned up][1] this [nice site][2] of sudokuish Garam puzzles yesterday. Fill in the blanks.&#xD;
&#xD;
![A Garam puzzle][3]&#xD;
&#xD;
Someone was quick to post [their Mathematica reduction][4]:&#xD;
&#xD;
![enter image description here][5]&#xD;
&#xD;
They had to enter the whole puzzle manually, a tedious task.&#xD;
&#xD;
The regular format and clean composition make these puzzles a tempting target for automation.&#xD;
&#xD;
Using colour frequency, I pick out the tiles of the puzzle with morphological tools.&#xD;
&#xD;
![Said puzzles tiles][6]&#xD;
&#xD;
By checking tile adjacency, I compile lists of &amp;#039;equations&amp;#039; reading down or across. Then the dark pixels in these tiles are extracted to collect the equation data. &#xD;
&#xD;
![Some equation imagery][7]&#xD;
&#xD;
A classifier turns the images into equations.&#xD;
&#xD;
![Some equations][8]&#xD;
&#xD;
Reduce solves all the equations for us, and churns out the answers left to right!&#xD;
&#xD;
![Solutions][9]&#xD;
&#xD;
Notebook attached for all your Garam cheating needs.&#xD;
&#xD;
&#xD;
  [1]: https://www.reddit.com/r/math/comments/3v9ik1/an_interesting_japanese_equation_puzzle_it_took/&#xD;
  [2]: https://www.garamgame.com/&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=PuzzlePaste.png&amp;amp;userId=445606&#xD;
  [4]: http://i.snag.gy/8cmhp.jpg&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=8cmhp.jpg&amp;amp;userId=11733&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=PuzzleTiles.png&amp;amp;userId=445606&#xD;
  [7]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Someequationimagery.PNG&amp;amp;userId=445606&#xD;
  [8]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Someequations.PNG&amp;amp;userId=445606&#xD;
  [9]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Solutions.PNG&amp;amp;userId=445606</description>
    <dc:creator>David Gathercole</dc:creator>
    <dc:date>2015-12-04T09:04:41Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/509162">
    <title>[Project] Human Cerebral Cortex with Real Data [MCIScreen]</title>
    <link>https://community.wolfram.com/groups/-/m/t/509162</link>
    <description>By the number of related disciplines, you may appreciate that this is a multidisciplinary problem of significant interest.&#xD;
I will start with the bottom line and then provide brief background.&#xD;
&#xD;
1. The Fundamental Problem: To Construct a 3-D Model of the 3 mm shell of the Human Cerebral Cortex so that microscopic neuroanatomic data specific to the six layers of 50 different cortical areas can be mapped onto it to show how the human cortex develops during the first six years of life.&#xD;
&#xD;
2. The Background: We have the largest, quantitative database available on the microscopic, neuroanatomic features of the developing human cerebral cortex.  In 1998, these data led to the overturning of the 100 year old dogma of no new neuron formation after birth, and ushered in the era of stem cell research.  The data were described by the NY Times as the most important scientific finding of the last decade of the 20th century.  Specifically, there are 8 age points of children who died of normal causes, at 0, 1, 3, 6, 15, 24, 48 and 72 months after birth.  At each age point, for each layer of 50 cortical areas, there are measures of the numbers of neurons, their size, the numbers of inputs (large dendrites) and outputs (axons), the thickness of each cortical layer, the surface area of each cortical area.  We have published that the signal-noise ratio of these data is extremely high, and that there is a common (undiscovered yet) pattern that characterizes the development of each cortical area.&#xD;
&#xD;
3. The Challenge: To build a 3-D model that can take the values of these microscopic, neuroanatomic features at each age point, layer, and cortical locus, so that these changes can be visualized and analyzed with more complex mathematical methods to discover the underlying rules governing the development of the human cerebral cortex.  These rules are likely to govern the structure of development of the cortex of other mammals.&#xD;
&#xD;
4. An Additional Challenge: We also have camera lucida drawings of the cortical columns of each of these 50 cortical areas for each of the 8 age points.  These camera lucida drawings are tracings of representative neurons in each layer of each cortical area.  By quantifying these 2-D images and making some assumptions about their 3-D representation, one could incorporate these data into the above model to learn even more.  Such research and development should lead to programs and algorithms of extraordinary power that will have use in many different disciplines.  I can see how different disciplines would approach this problem in different ways, which is why I posted so many fields of interest.&#xD;
&#xD;
If anyone would like to know more, or has suggestions for developing this project, I have the database, am a statistician and cognitive scientist by training and experience, and am one of the clinical authorities on Alzheimer&amp;#039;s disease and other dementing disorders, which is essentially the reverse of development.  &#xD;
&#xD;
I would appreciate input from anyone with a creative streak and a taste for a challenging problem.&#xD;
&#xD;
Thanks very much&#xD;
&#xD;
Rod Shankle, MS MD FACP&#xD;
&#xD;
PS: I have attached a PNAS article giving a nice brief summary of the data.</description>
    <dc:creator>William Shankle</dc:creator>
    <dc:date>2015-06-04T05:57:54Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1730668">
    <title>[WSC19] Character Analysis</title>
    <link>https://community.wolfram.com/groups/-/m/t/1730668</link>
    <description>## Introduction ##&#xD;
The advent of the field of artificial intelligence initiated various industries, with a prominent one being digit evaluation. The most common AI assisted image processing project to date is the handwritten digit analysis utilizing the MNIST data set, which contains various data samples on handwritten digits, which are organized into uniform sizes. This project is an extension to this, by evaluating handwritten characters (for example, from the EMNIST dataset), and progresses to recognizing whole words and evaluating &amp;#034;possible&amp;#034; words that can be derived from writing. &#xD;
&#xD;
## Collecting Data ##&#xD;
There are various datasets available online, however we will be using the EMNIST dataset (Extended MNIST) which contains both characters and digits. The EMNIST dataset includes:&#xD;
&#xD;
 - Datasets organized into: Byclass, Bymerge, Balanced, Letters, and Digits&#xD;
 - Both training and test data according to those organizations&#xD;
 - A mapping to convert from class to ASCII decimal codes. &#xD;
&#xD;
For our training purposes, we will be using the balanced training dataset, which is meant to address misclassification errors that occur in the byclass and bymerge datasets. There are a total of 47 classes in the EMNIST Balanced set. &#xD;
&#xD;
Link: https://www.kaggle.com/crawford/emnist&#xD;
&#xD;
After that, we import the downloaded files.&#xD;
&#xD;
    balancedTrainData = &#xD;
     Import[&amp;#034;/Users/danielshin/Desktop/wf_proj/data/emnist/train/emnist-\&#xD;
    balanced-train.csv&amp;#034;, &amp;#034;Data&amp;#034;];&#xD;
    balancedMap = &#xD;
     Import[&amp;#034;/Users/danielshin/Desktop/wf_proj/data/emnist/mapping/emnist-\&#xD;
    balanced-mapping.txt&amp;#034;;&#xD;
    balancedTestData = &#xD;
      Import[&amp;#034;/Users/danielshin/Desktop/wf_proj/data/emnist/test/emnist-\&#xD;
    balanced-test.csv&amp;#034;, &amp;#034;Data&amp;#034;];&#xD;
&#xD;
## Structure of the EMNIST Dataset ##&#xD;
Unlike the MNIST dataset, which is already included in the wolfram data repository, it is necessary for us to process the data provided by the EMNIST dataset before we can perform operations on it. &#xD;
&#xD;
 - The EMNIST dataset is a list of sublists of length 785.&#xD;
 - This is because every list is an image classified by its class. Each image is of size 28x28 (28^2 = 784), and one number is allocated to indicate the class (letter or number) of the image. &#xD;
&#xD;
As the dataset includes 13 thousand image samples, we will be taking some examples from the set and run operations on it:&#xD;
&#xD;
    test = RandomSample[balancedTrainData, 5];&#xD;
    convertedTest = &#xD;
     Image /@ Transpose /@ (Divide[#, 255] &amp;amp; /@ &#xD;
       Partition[#[[All]][[2 ;;]], 28] &amp;amp; /@ test)&#xD;
    withIndexTest = &#xD;
     Table[{test[[n, 1]], convertedTest[[n]]}, {n, 1, Length[test]}]&#xD;
This returns:&#xD;
![output of variable withIndexTest][1]&#xD;
&#xD;
&#xD;
Similarly, both the training and test dataset can be converted to the appropriate format with this code. However, we can also see that the classes are quite ambiguous. The classes indicated by the EMNIST dataset does not correspond to any character code format. To deal with this, EMNIST provides a mapping .txt file, which converts the classes to ASCII decimal character code format. &#xD;
&#xD;
    words = TextWords[balancedMap];&#xD;
    cvtCode2Char[code_Integer] := &#xD;
     FromCharacterCode[&#xD;
      ToExpression[words[[Position[words, ToString[code]][[1, 1]] + 1]]]]&#xD;
&#xD;
The **cvtCode2Char** function helps to convert a class to the actual character.&#xD;
&#xD;
Also, we need a special method of indexing to feed the data into the neural network. The neural network accepts a list of associations, which can be converted to with the following code:&#xD;
&#xD;
    cvtIndex2Train[index_List] := &#xD;
     Table[index[[n, 2]] -&amp;gt; index[[n, 1]], {n, 1, Length[index]}]&#xD;
** Note that this function can be used both for the training and testing dataset. &#xD;
&#xD;
## Creating a CNN to Analyze and Interpret Characters ##&#xD;
A convolutional neural network, also known as CNN, is a deep neural network most commonly utilized to perform image processing. CNN structures are similar to the human eye, breaking down and extracting features that are crude or complex. A typical CNN is a combination of convolutional layers, activation functions, and pooling layers. &#xD;
&#xD;
The final neural network created for this project is shown in the code below:&#xD;
&#xD;
    convolutionalNeuralNet = NetChain[{&#xD;
       ConvolutionLayer[20, 5],&#xD;
       Ramp, PoolingLayer[2, 2],&#xD;
       ConvolutionLayer[50, 5],&#xD;
       Ramp, PoolingLayer[2, 2],&#xD;
       FlattenLayer[], DropoutLayer[],&#xD;
       LinearLayer[500], Ramp, LinearLayer[47],&#xD;
       SoftmaxLayer[]},&#xD;
      &amp;#034;Output&amp;#034; -&amp;gt; NetDecoder[{&amp;#034;Class&amp;#034;, Range[0, 46]}],&#xD;
      &amp;#034;Input&amp;#034; -&amp;gt; NetEncoder[{&amp;#034;Image&amp;#034;, {28, 28}, &amp;#034;Grayscale&amp;#034;}]&#xD;
      ]&#xD;
&#xD;
There were many iterations of the neural network based on optimizer types and the addition/subtraction of specific layers. First of all, a dropout layer, included to assist in the vanishing gradient problem, was added (and deleted) to check whether it might have an influence on performance. &#xD;
![With vs. Without DropoutLayer][2]&#xD;
Furthermore, research into convolutional neural nets revealed two optimizers that are currently industry-standard, which were the ADAM and SGD optimizers. A comparison between these two optimizers are shown below:&#xD;
![Adam vs. SGD][3]&#xD;
With this, it was revealed that for our purposes, an SGD optimizer used with a DropoutLayer[] was the best combination in terms of neural network accuracy. &#xD;
&#xD;
Code used to train network:&#xD;
&#xD;
    balancedTrainingData = cvtIndex2Train[indexed];&#xD;
    convolutionalNeuralNet = NetInitialize[convolutionalNeuralNet];&#xD;
    trained = &#xD;
     NetTrain[convolutionalNeuralNet, balancedTrainingData, &#xD;
      Method -&amp;gt; &amp;#034;SGD&amp;#034;]&#xD;
&#xD;
## Evaluating Probabilities of Outputs ##&#xD;
Obviously, it is difficult for a neural network to return 100% probability for a single class for every image input. For each classification, there is a probability value associated with it. However, many probability values (especially those that are small) aren&amp;#039;t that useful. &#xD;
&#xD;
    returnTopPossible[input_Image, int_Integer] := &#xD;
     Table[{cvtCode2Char[#[[n, 1]]], #[[n, 2]]}, {n, 1, int}] &amp;amp;[&#xD;
      Flatten /@ &#xD;
       List @@@ Normal@ReverseSort[net[input, &amp;#034;Probabilities&amp;#034;]][[;; int]]]&#xD;
&#xD;
The returnTopPossible function can help to return the top few probabilities based on a given input. &#xD;
![Sample &amp;#034;returnTopPossible&amp;#034; function output][4]&#xD;
&#xD;
Now, it is important to note that probability values range from 0~1, so 0.92 will indicate 92%. The reason why we limit the probability outputs to a few values is because there is only a minimal chance that the neural net processed an image correctly with only an output probability of, lets say, 1/10000.&#xD;
&#xD;
## Testing on Images Not from EMNIST ##&#xD;
While EMNIST provides diverse data, still the format is similar, so we decided to test the neural network on other external images obtained from the internet. &#xD;
&#xD;
    testImage2 = &#xD;
         ColorConvert[&#xD;
           ImageResize[&#xD;
            Import[&amp;#034;/Users/danielshin/Desktop/test.png&amp;#034;], {28, 28}], &#xD;
           &amp;#034;Grayscale&amp;#034;] // ColorNegate;&#xD;
    Thread[testImage2 -&amp;gt; returnTopPossible[testImage2, 5]]&#xD;
&#xD;
The output of the testing processed was quite satisfying:&#xD;
![Detect Q][5]&#xD;
&#xD;
As shown, the neural network outputted a confidence score of the 96% for the image to be the capital letter &amp;#034;Q&amp;#034;.&#xD;
&#xD;
The reason we converted the image to grayscale, and then performed a color negate was because the EMNIST dataset is comprised of images that are white in a black background. Therefore, the results of the neural network is vastly inconsistent when we input an image with a white background. &#xD;
&#xD;
## Finding Characters in a Word ##&#xD;
The neural network we made previously is confined to detecting characters that are confined specifically to an image of size 28x28. But what if there are multiple letters in an image, and the image is not in the appropriate dimensions to be reduced? In this section, we will be creating methods to detect multiple characters out of a single image. &#xD;
&#xD;
For instance, if we have the image down below, our current neural network can&amp;#039;t detect it properly. &#xD;
&#xD;
![New][6]&#xD;
&#xD;
First of all, we extract each letter from the image using functions such as Morphological Components.&#xD;
We created a function called selectChar which outputs a list of images that are single characters extracted from an image of a word.&#xD;
&#xD;
    selectChar[image_, negate_: True] := Module[&#xD;
      {binarized, length},&#xD;
      binarized = &#xD;
       If[negate, ColorNegate[Binarize[image]], Binarize[image]];&#xD;
      length = &#xD;
       Length[Union[Flatten[MorphologicalComponents[binarized]]]] - 1;&#xD;
      Table[SelectComponents[binarized, #Label == n &amp;amp;], {n, 1, length}]&#xD;
      ]&#xD;
    selectChar[word]&#xD;
** Note that the &amp;#034;negate&amp;#034; parameter is defaulted to True, as we assume that the image has a white background by default. &#xD;
&#xD;
When the function is applied to the image shown above, it outputs:&#xD;
![New Divided][7]&#xD;
However, it is evident that these words are not organized properly, so if we run the neural network on words that are the way that is the network will return &amp;#034;Nwe&amp;#034; not &amp;#034;New&amp;#034;. Therefore, we need a method to organize the images from left to right. In our case, we utilized pixel positions and got the leftmost pixel coordinates to order each image. &#xD;
&#xD;
    orderFromLeft[charList_] := &#xD;
     Table[#[[i, 1]], {i, 1, Length[charList]}] &amp;amp;[&#xD;
      SortBy[Table[{charList[[n]], &#xD;
         SortBy[PixelValuePositions[charList[[n]], 1], First][[1, &#xD;
          1]]}, {n, 1, Length[charList]}], Last]]&#xD;
&#xD;
However, what about letters like &amp;#034;i&amp;#034;, or &amp;#034;E&amp;#034; in this case? Letters like that have separations between the top and bottom part, but utilizing MorphologicalComponents will separate them and classify them into different components, as shown in the image below:&#xD;
![MOVE][8]&#xD;
&#xD;
A function called checkOverlap was created to determine whether to combine components together to form a whole image:&#xD;
&#xD;
    checkOverlap[image1_, image2_] := Module[&#xD;
      {overlap, imgW},&#xD;
      imgW = Min[&#xD;
        Max[First /@ PixelValuePositions[image1, 1]] - &#xD;
         Min[First /@ PixelValuePositions[image1, 1]], &#xD;
        Max[First /@ PixelValuePositions[image2, 1]] - &#xD;
         Min[First /@ PixelValuePositions[image2, 1]]];&#xD;
      overlap = &#xD;
       Min[Max[First /@ PixelValuePositions[image1, 1]], &#xD;
         Max[First /@ PixelValuePositions[image2, 1]]] - &#xD;
        Max[Min[First /@ PixelValuePositions[image1, 1]], &#xD;
         Min[First /@ PixelValuePositions[image2, 1]]];&#xD;
      If[imgW*0.3 &amp;lt; overlap, True, False]]&#xD;
&#xD;
Still, we can&amp;#039;t just feed these images to the neural network. The network chain was defined to take in an image that is of size 28x28. Therefore, we need to find a way to trim and reshape the images into a 28x28 box. &#xD;
&#xD;
    reshape[image_] := Module[&#xD;
      {h, w, trimmed, targetH = 26, targetW = 26, fw, fh, scale,&#xD;
        resizedImage, rectangle},&#xD;
      trimmed = ImageCrop[image];&#xD;
      {w, h} = ImageDimensions[trimmed];&#xD;
      fw = w / targetW;&#xD;
      fh = h / targetH;&#xD;
      scale = Max[fw, fh];&#xD;
      resizedImage = &#xD;
       ImageResize[trimmed, {Max[w/scale, 1], Max[h/scale, 1]}];&#xD;
      rectangle = Image[Table[Table[0, 28], 28]];&#xD;
      ImageCompose[rectangle, resizedImage, {Center}]&#xD;
      ]&#xD;
&#xD;
Finally, there were instances where images contain noise. These random particles were also extracted from morphological components and were resized. To filter these noise out, we decided to compare the black pixel to white pixel ratio. Assuming that each noise is a circle, the ratio would be 0.25 Pi : 1, which is about 615 pixels per 784. &#xD;
&#xD;
    filter[images_] := &#xD;
     Select[Table[&#xD;
       If[Length[PixelValuePositions[images[[n]], 1]] &amp;lt; 615, &#xD;
        images[[n]]], {n, 1, Length[images]}], ImageQ]&#xD;
&#xD;
Still, we realized that by only using image processing, it was hard to get accurate results. Therefore, we decided to employ other methods such as character associations as well. Character association is basically a map of characters and their associations. For instance, &amp;#034;q&amp;#034; is almost always followed by a &amp;#034;u&amp;#034;, etc. &#xD;
&#xD;
![Graph][9]&#xD;
&#xD;
This is the character association map that was created. &#xD;
&#xD;
## Overarching Prediction Algorithm ##&#xD;
This was the function utilized to create the final algorithm (that encompasses both the image and association probabilities)&#xD;
&#xD;
    trail[input_, weights_, edges_, negate_: True] := Module[&#xD;
      {wordList, probabilityList},&#xD;
      wordList = Tuples[imageProbability[moveWord, negate]];&#xD;
      probabilityList = Table[outputProbability[&#xD;
         Select[wordList[[n]] // Flatten, NumberQ],&#xD;
         associationProbability[&#xD;
          Select[wordList[[n]] // Flatten, StringQ],&#xD;
          edgeWeights, withoutDuplicates&#xD;
          ]], {n, Length[wordList]}];&#xD;
      Select[wordList[[&#xD;
           Position[probabilityList, Max[probabilityList]][[1, 1]]]] // &#xD;
          Flatten, StringQ] // ToLowerCase // StringJoin&#xD;
      ]&#xD;
&#xD;
 - imageProbability is a function which outputs classification probabilities of each image.&#xD;
 - associationProbability is a function which outputs the probabilities of word associations based on the character association map.&#xD;
&#xD;
We combined these two probabilities to create a final output. &#xD;
&#xD;
## Conclusion &amp;amp; Future Works ##&#xD;
During this project, algorithms were designed to recognize words in an image. However, results weren&amp;#039;t exactly as satisfying as expected. The accuracy of the trained neural network was quite high, but there were some other issues as well. Using character-based relationships, the program successfully impedes consonants from following consonants, such as &amp;#034;Q&amp;#034; following &amp;#034;M&amp;#034;, however the replaced vowel wasn&amp;#039;t always quite accurate.  Other attempts were made, such as adding weights as well. Only after creating weights to decrease the influence of the character association map, was the combination of the two probabilistic values yielded confident results. &#xD;
&#xD;
There are various methods on simulating OCR. For future works, creating neural networks to input whole words and sentences will be able to create a more feasible and easy-to-use product. Furthermore, utilizing similar concepts from this project, using word-mapping (Markov chains), it might be possible to predict wrong characters or words in a sentence, and using image processing neural networks to compensate and replace certain characters. &#xD;
&#xD;
### Links ###&#xD;
&#xD;
 - https://www.kaggle.com/crawford/emnist&#xD;
 - [https://commons.wikimedia.org/wiki/File:Math_i_square.png][10]&#xD;
 - https://www.codeproject.com/Articles/160868/A-C-Project-in-Optical-Character-Recognition-OCR-U&#xD;
 - http://www.fki.inf.unibe.ch/databases/iam-handwriting-database https://www.dreamstime.com/handwritten-word-new-white-background-can-be-used-different-concepts-handwritten-word-new-white-background-image104188885&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2019-07-11at10.00.15AM.png&amp;amp;userId=1720539&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2019-07-11at10.14.20AM.png&amp;amp;userId=1720539&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2019-07-11at10.16.12AM.png&amp;amp;userId=1720539&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2019-07-11at10.25.58AM.png&amp;amp;userId=1720539&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2019-07-11at10.32.48AM.png&amp;amp;userId=1720539&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=test1.png&amp;amp;userId=1720539&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2019-07-11at10.43.47AM.png&amp;amp;userId=1720539&#xD;
  [8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2019-07-11at10.50.23AM.png&amp;amp;userId=1720539&#xD;
  [9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2019-07-11at11.13.20AM.png&amp;amp;userId=1720539&#xD;
  [10]: https://commons.wikimedia.org/wiki/File:Math_i_square.png</description>
    <dc:creator>Daniel Shin</dc:creator>
    <dc:date>2019-07-11T15:19:26Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1137429">
    <title>[WSS17] DeepLaetitia: Deep Reinforcement Learning that makes you smile</title>
    <link>https://community.wolfram.com/groups/-/m/t/1137429</link>
    <description>![Main picture][1]&#xD;
&#xD;
# Introduction&#xD;
&#xD;
The aim of this project is to train a Deep Reinforcement Learning agent to bring a smile to your face.  &#xD;
The first part of the project was to train a Deep Convoluted Neural Network to predict one of five (happy, neutral, sad, angry, surprised) facial emotions.&#xD;
The input to this classifier is taken directly from the user&amp;#039;s camera.   &#xD;
Then, using this prediction as an input, a reinforcement learning agent was trained to make you smile. To do that a customizable emoticon was used. &#xD;
&#xD;
## Why Laetitia?&#xD;
&#xD;
Laetitia is the Roman Goddess of joy, gaiety, and celebration, and is especially linked with holidays and festivals. &#xD;
&#xD;
&#xD;
# Phase one: facial emotion detector&#xD;
The first phase of the project was to implement the facial emotion detector. &#xD;
&#xD;
## Dataset &#xD;
The very first part of this phase was dataset selection. I based my study on the Fe.r2013 database.  &#xD;
It is free and available online on [Kaggle platform][2]. The reason standing behind my choice were small size of training example (pictures 48x48 pixels), huge number of labeled training O(20k) and test O(7k)  examples. Each of database element belongs to one of following classes happy, neutral, sad, angry and surprised.   &#xD;
Unfortunately, the database is contaminated by noised images or animated faces. It needed lot of afford to manually remove all the useless examples.  &#xD;
&#xD;
![training examples][3]    &#xD;
&#xD;
## Model training&#xD;
&#xD;
At the beginning of my study I trained classical Machine Learning models, such as Supported Vector Machine, Random Forest, k Nearest Neighborhood. These models were used as a performance baseline for further studies based on Deep Convoluted Neural Networks. &#xD;
My analysis shows that models that contain two hidden convoluted layers are the best classifiers. A selected model achieved a performance of 91% in happiness recognition, measured as area under Receiver Operating Characteristic curve.  &#xD;
&#xD;
As mentioned before, the best facial emotion detector is a Deep Convolution Neural Network.  &#xD;
Above cell presents architecture (upper right plot) of selected network and training progress related plots. &#xD;
&#xD;
![CNN training][4]&#xD;
&#xD;
##  Convoluted Neural Network performance&#xD;
Classifier performance measurement was performed on O(7k) testing images. &#xD;
At first  I present a confusion matrix which is a specific table layout that allows visualization of the performance of an algorithm. Each column of the matrix represents the instances in a predicted class while each row represents the instances in an actual class. The name stems from the fact that it makes it easy to see if the system is confusing two classes (i.e. commonly mislabelling one as another).&#xD;
![cm][5]&#xD;
&#xD;
Another widely used classifier performance measuring metrics is the area under the Receiver Operating Characteristic curve, which can be interpreted as equal to the probability that a classifier will rank a randomly chosen positive instance higher than a randomly chosen negative one.  &#xD;
The obtained results for particular classes:&#xD;
 ![rocs][6]&#xD;
## Classifier evaluation&#xD;
&#xD;
The crucial project constraint is classifier evaluation time. The classifier need to be able to return response in real time. Here you find sample. The delays are caused by gif segmentation.  &#xD;
&#xD;
![sample][7]&#xD;
&#xD;
## Transfer learning approach&#xD;
I also tried to use idea of transfer learning. Roughly speaking, we take pre-trained  model such as [VGG16](http://www.robots.ox.ac.uk/~vgg/research/very_deep/) or [Inception](https://arxiv.org/abs/1512.00567) and then replace two last layers. &#xD;
&#xD;
    emotionTypes = {&amp;#034;happy&amp;#034;, &amp;#034;neutral&amp;#034;, &amp;#034;sad&amp;#034;, &amp;#034;angry&amp;#034;, &amp;#034;surprise&amp;#034;}&#xD;
    deepCNN = NetModel[&amp;#034;Wolfram ImageIdentify Net for WL 11.1&amp;#034;]&#xD;
    truncatedNetwork = Take[deepCNN, {1, -3}];&#xD;
    deepCNNInceptionV3 = &#xD;
     NetInitialize @&#xD;
      NetChain[{truncatedNetwork, LinearLayer[Length[emotionTypes]], &#xD;
        SoftmaxLayer[]},&#xD;
       &amp;#034;Output&amp;#034; -&amp;gt; NetDecoder[{&amp;#034;Class&amp;#034;, emotionTypes}]&#xD;
      ]&#xD;
&#xD;
Unfortunately, due to technical limitation of my notebook (no GPU unit) I was not able to finish training that kind of model. It probably will perform better than shallow version. This idea will be implemented in the future release of the project.  &#xD;
&#xD;
# Phase Two: Reinforcement Learning&#xD;
In this phase, based on chosen model prediction, the policy to find the funniest emoticon was obtained. To do it the Monte Carlo based searching method was applied. &#xD;
At first I would like to present tunable emoticon that was used to make you smile. The animation was taken from [Wolfram Demonstration Project site](http://demonstrations.wolfram.com/SmileyChanger/).&#xD;
&#xD;
 ![emoticon][8] &#xD;
&#xD;
This element will be replaced into auto generated pictures or jokes in the future release. &#xD;
## Monte Carlo optimization &#xD;
&#xD;
Monte Carlo methods (or Monte Carlo experiments) are a broad class of computational algorithms that rely on repeated random sampling to obtain numerical results. Their essential idea is using randomness to solve problems that might be deterministic in principle.&#xD;
&#xD;
From the point of view this work I am using numerical simulation to find the &amp;#034;funniest&amp;#034; emoticon configuration. Please take a look at the simulation sudo code. &#xD;
&#xD;
    nFrames = 10;&#xD;
    currentHappines = 0.;&#xD;
    previousHappines = 0.; &#xD;
    happinessesList = {{r, t , s, a , b, c , ey , er, currentHappines}};&#xD;
    ResetParameters[];&#xD;
    &#xD;
    Dynamic[&#xD;
     parameter = SelectParameter[];&#xD;
     previousParamValue = KeepPreviousParameterValue[parameter];&#xD;
     update =  CalculateParameterUpdate[parameter, step];&#xD;
     UpdateParmeter[parameter, update];&#xD;
     &#xD;
     frame = 0;&#xD;
     currentHappines = 0.;&#xD;
     Column[{ animation,&#xD;
       While[frame &amp;lt; nFrames,&#xD;
        image = CurrentImage[];&#xD;
        greyFace = ExtractFaceFromImage[image];&#xD;
        currentHappines += PredictHappinessProbability[greyFace];&#xD;
        frame++;&#xD;
        ];&#xD;
       currentHappines /= nFrames; image, greyFace, currentHappines, &#xD;
       If[currentHappines &amp;gt; previousHappines , &#xD;
        previousHappines =  currentHappines, &#xD;
        ReloadParameterValue[parameter, previousParamValue]];&#xD;
       happinessesList = &#xD;
        Join [happinessesList, {{r, t , s, a , b, c , ey , er, &#xD;
           currentHappines}}];}&#xD;
      ]&#xD;
     &#xD;
     ]&#xD;
     &#xD;
 This simulation allows to obtain learning curve like plot and the from them funniest emoticon configuration.&#xD;
  &#xD;
 ![learningCurveMC][9]&#xD;
&#xD;
#Future goals &#xD;
From the future perspective the Q-Learning approach will be implemented. A starting point of the further studies will be Monte Carlo tuned policy mentioned before.&#xD;
&#xD;
&#xD;
&#xD;
The second idea is to replaced shallow version of CNN into pre-trained model. &#xD;
# Github&#xD;
Please take a look at the project source code on [github](https://github.com/adendek/DeepLaetitia). &#xD;
&#xD;
&#xD;
####Stay tuned for further improvements!&#xD;
####Im happy about any kind of feedback. Please upvote if you like it ;-)&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Classifier.gif&amp;amp;userId=1075716&#xD;
  [2]: https://www.kaggle.com/c/challenges-in-representation-learning-facial-expression-recognition-challenge &amp;#034;Kaggle&amp;#034;&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=images.png&amp;amp;userId=1075716&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=trainingResult.png&amp;amp;userId=1075716&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=CM.png&amp;amp;userId=1075716&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Rocs.png&amp;amp;userId=1075716&#xD;
  [7]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Reaction.gif&amp;amp;userId=1075716&#xD;
  [8]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Emoticon.png&amp;amp;userId=1075716&#xD;
  [9]: http://community.wolfram.com//c/portal/getImageAttachment?filename=MonteCarlo.png&amp;amp;userId=1075716</description>
    <dc:creator>Adam Dendek</dc:creator>
    <dc:date>2017-07-05T22:32:13Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1661864">
    <title>Mathematica 12 Launch</title>
    <link>https://community.wolfram.com/groups/-/m/t/1661864</link>
    <description>[![enter image description here][1]][46]&#xD;
&#xD;
We&amp;#039;re glad to announce that Version 12.0 of Mathematica and the Wolfram Language is hereand it&amp;#039;s a big one. This major update introduces several hundred new functions in a range of areas, including mathematics and geometry, visualization, audio and image processing, machine learning, and more, as well as provides a major overhaul to the Mac and Linux notebook interfaces and numerous systemwide performance enhancements. Some key new features include:&#xD;
&#xD;
Mathematics and Geometry&#xD;
-------------------------------------&#xD;
 - Convex optimization solvers such as [LinearOptimization][2],&#xD;
   [QuadraticOptimization][3] and [SemidefiniteOptimization][4], with vector&#xD;
   inequalities such as [VectorGreater][5] for modeling vector-valued&#xD;
   variables&#xD;
 - Improved [NDSolve][6] support for nonlinear PDEs using FEM and automated&#xD;
   idealized *n*-body interaction using [NBodySimulation][7]&#xD;
 - Use [Around][8] to describe uncertainty in measured values, with built-in&#xD;
   support in visualization functions&#xD;
 - A host of new functions for generating, analyzing and manipulating&#xD;
   polygons and polyhedra ([RandomPolygon][9], [RandomPolyhedron][10],&#xD;
   [PolygonDecomposition][11], etc.), with added support for holes/voids&#xD;
 - Access built-in axiomatic theories for use in symbolic proofs with&#xD;
   [AxiomaticTheory][12]&#xD;
&#xD;
Visualization&#xD;
----------------&#xD;
 - [GeometricScene][13] and [GeometricAssertion][14] for visualizing Euclidean&#xD;
   geometry and its theorems&#xD;
 - Visualize different components and properties of complex-valued data&#xD;
   and functions with [ComplexListPlot][15], [ReImPlot][16] and [AbsArgPlot][17]&#xD;
 - Represent geodetic vectors with [GeoVector][18] and visualize geodetic&#xD;
   vector fields using [GeoVectorPlot][19] and [GeoStreamPlot][20]&#xD;
 - Updated default appearance for [GraphPlot][21] visualizations, as well as&#xD;
   new plot themes and updated properties&#xD;
 - Create, analyze and modify chemical species with [Molecule][22] and&#xD;
   visualize their 2D and 3D structures with [MoleculePlot][23] and&#xD;
   [MoleculePlot3D][24]&#xD;
&#xD;
Audio and Image Processing&#xD;
---------------------------------------&#xD;
 - Color-processing functions such as [FindMatchingColor][25], [ImageRecolor][26]&#xD;
   and [ColorDetect][27], all powered by the new [ColorsNear][28] wrapper to&#xD;
   represent a color neighborhood&#xD;
 - Multi-language support for [SpeechSynthesize][29], as well as improved&#xD;
   discovery and searching of available voices through [VoiceStyleData][30]&#xD;
 - [AudioAnnotate][31] framework for annotating audio objects&#xD;
 - [ShortTimeFourier][32] for computing and storing properties of short-time&#xD;
   Fourier transforms and [InverseSpectrogram][33] for approximating a signal&#xD;
   from a magnitude spectrogram&#xD;
&#xD;
Machine Learning and Neural Networks&#xD;
------------------------------------&#xD;
 - High-level recognition functions such as [ImageCases][34], [FacialFeatures][35],&#xD;
   [AudioIdentify][36] and [SpeechRecognize][37]&#xD;
 - Additional pre-trained models, new layers, new encoders and decoders,&#xD;
   and multi-GPU support for the neural network framework&#xD;
 - Learn a generalized probability distribution from arbitrary data&#xD;
   using [LearnDistribution][38]&#xD;
 - Replace missing values in data by generated values using&#xD;
   [SynthesizeMissingValues][39] and find anomalous examples in data using&#xD;
   [FindAnomalies][40]&#xD;
&#xD;
These are just a few of the highlights from this release, which also includes an experimental [Wolfram Compiler][41], a comprehensive new [Microcontroller Kit][42], a bidirectional [Unity][43] game engine interface and expanded knowledge and functionality for [Entity][44] and [EntityStore][45].&#xD;
&#xD;
You can find out more about these and other Version 12 additions by reading through [Stephen Wolfram&amp;#039;s launch-day blog post][46] and looking at the [Summary of New Features in 12][47].&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=12-0-wordcloud-hero.png&amp;amp;userId=11733&#xD;
  [2]: http://reference.wolfram.com/language/ref/LinearOptimization&#xD;
  [3]: http://reference.wolfram.com/language/ref/QuadraticOptimization&#xD;
  [4]: http://reference.wolfram.com/language/ref/SemidefiniteOptimization&#xD;
  [5]: http://reference.wolfram.com/language/ref/VectorGreater&#xD;
  [6]: http://reference.wolfram.com/language/ref/NDSolve&#xD;
  [7]: http://reference.wolfram.com/language/ref/NBodySimulation&#xD;
  [8]: http://reference.wolfram.com/language/ref/Around&#xD;
  [9]: http://reference.wolfram.com/language/ref/RandomPolygon&#xD;
  [10]: http://reference.wolfram.com/language/ref/RandomPolyhedron&#xD;
  [11]: http://reference.wolfram.com/language/ref/PolygonDecomposition&#xD;
  [12]: http://reference.wolfram.com/language/ref/AxiomaticTheory&#xD;
  [13]: http://reference.wolfram.com/language/ref/GeometricScene&#xD;
  [14]: http://reference.wolfram.com/language/ref/GeometricAssertion&#xD;
  [15]: http://reference.wolfram.com/language/ref/ComplexListPlot&#xD;
  [16]: http://reference.wolfram.com/language/ref/ReImPlot&#xD;
  [17]: http://reference.wolfram.com/language/ref/AbsArgPlot&#xD;
  [18]: http://reference.wolfram.com/language/ref/GeoVector&#xD;
  [19]: http://reference.wolfram.com/language/ref/GeoVectorPlot&#xD;
  [20]: http://reference.wolfram.com/language/ref/GeoStreamPlot&#xD;
  [21]: http://reference.wolfram.com/language/ref/GraphPlot&#xD;
  [22]: http://reference.wolfram.com/language/ref/Molecule&#xD;
  [23]: http://reference.wolfram.com/language/ref/MoleculePlot&#xD;
  [24]: http://reference.wolfram.com/language/ref/MoleculePlot3D&#xD;
  [25]: http://reference.wolfram.com/language/ref/FindMatchingColor&#xD;
  [26]: http://reference.wolfram.com/language/ref/ImageRecolor&#xD;
  [27]: http://reference.wolfram.com/language/ref/ColorDetect&#xD;
  [28]: http://reference.wolfram.com/language/ref/ColorsNear&#xD;
  [29]: http://reference.wolfram.com/language/ref/SpeechSynthesize&#xD;
  [30]: http://reference.wolfram.com/language/ref/VoiceStyleData&#xD;
  [31]: http://reference.wolfram.com/language/ref/AudioAnnotate&#xD;
  [32]: http://reference.wolfram.com/language/ref/ShortTimeFourier&#xD;
  [33]: http://reference.wolfram.com/language/ref/InverseSpectrogram&#xD;
  [34]: http://reference.wolfram.com/language/ref/ImageCases&#xD;
  [35]: http://reference.wolfram.com/language/ref/FacialFeatures&#xD;
  [36]: http://reference.wolfram.com/language/ref/AudioIdentify&#xD;
  [37]: http://reference.wolfram.com/language/ref/SpeechRecognize&#xD;
  [38]: http://reference.wolfram.com/language/ref/LearnDistribution&#xD;
  [39]: http://reference.wolfram.com/language/ref/SynthesizeMissingValues&#xD;
  [40]: http://reference.wolfram.com/language/ref/FindAnomalies&#xD;
  [41]: http://reference.wolfram.com/language/guide/CodeCompilation&#xD;
  [42]: http://reference.wolfram.com/language/MicrocontrollerKit/guide/MicrocontrollerKit&#xD;
  [43]: http://reference.wolfram.com/language/UnityLink/guide/UnityLink&#xD;
  [44]: http://reference.wolfram.com/language/ref/Entity&#xD;
  [45]: http://reference.wolfram.com/language/ref/EntityStore&#xD;
  [46]: http://wolfr.am/launching-12&#xD;
  [47]: http://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn12.html</description>
    <dc:creator>Brian Wood</dc:creator>
    <dc:date>2019-04-16T16:11:50Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/401698">
    <title>How rasberry pi is used in image processing?</title>
    <link>https://community.wolfram.com/groups/-/m/t/401698</link>
    <description>I am new to image processing. I want to know that how rasberry pi camera is used? Is it suitable for real time projects?  How other camera are interfaced to raspberry pi? Any other methods for doing image processing? I would be greatful for your answer.Thanks!</description>
    <dc:creator>nabin ghimire</dc:creator>
    <dc:date>2014-12-04T07:49:51Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2144200">
    <title>[WELP20] Acoustic Modeling with Generated Depth Maps</title>
    <link>https://community.wolfram.com/groups/-/m/t/2144200</link>
    <description>&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/d34dbf01-6652-4598-9cff-6aad9b015495</description>
    <dc:creator>Wolfram Education Programs</dc:creator>
    <dc:date>2020-12-21T18:20:08Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1893009">
    <title>How to build a mammuthus with your kids</title>
    <link>https://community.wolfram.com/groups/-/m/t/1893009</link>
    <description>According to the [official announcement][1]:&#xD;
&#xD;
&amp;gt; For the first time in its 174-year history, the Smithsonian has released 2.8 million high-resolution two- and three-dimensional images from across its collections onto an open access online platform for patrons to peruse and download free of charge. Featuring data and material from all 19 Smithsonian museums, nine research centers, libraries, archives and the National Zoo, the new digital depot encourages the public to not just view its contents, but use, reuse and transform them into just about anything they choose&amp;#x2014;be it a postcard, a beer koozie or a pair of bootie shorts.&#xD;
&#xD;
*COLLECTION is HERE*: https://www.si.edu/openaccess&#xD;
&#xD;
There are a lot of interesting and images and 3D models from very diverse corners of life, - here are a few samples: &#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
One of coolest thing is that some of 3D models are given in parts that can be 3D printed separately and then assembled together, thus making cool DIY project. Here is an example you can try with a 3D model of [Mammuthus primigenius / Blumbach][3]. Below the model find and copy the download link:&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
&#xD;
Import data from the collection (I shortened the URL with `URLShorten`):&#xD;
&#xD;
    data = Import[&amp;#034;https://wolfr.am/KQ6NWYff&amp;#034;, &amp;#034;*&amp;#034;]&#xD;
&#xD;
![enter image description here][5]&#xD;
&#xD;
You can see these are the pieces that should make up a whole object:&#xD;
&#xD;
    Show[data]&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
It is easy to make 3D printouts with the Wolfram Language -- the parts &#xD;
&#xD;
    Printout3D /@ data&#xD;
&#xD;
or whole thing:&#xD;
&#xD;
    Printout3D[RegionUnion @@ data]&#xD;
&#xD;
![enter image description here][7]&#xD;
&#xD;
It is a really neat toy and reminds me of 3D puzzles: you get the parts and have to figure out what the whole is by building it. Could be a fun time with kids :-) If you can get your hands on 3D printer it might be better than a toy store. There are very different types too. Here is, for instance for space-dreamers, the [Apollo 11 Command Module][8] -- apart and together.&#xD;
&#xD;
    apollo = Import[&amp;#034;https://wolfr.am/KQLE0LOx&amp;#034;, &amp;#034;*.obj&amp;#034;]&#xD;
&#xD;
![enter image description here][9]&#xD;
&#xD;
    Show[apollo]&#xD;
&#xD;
![enter image description here][10]&#xD;
&#xD;
&#xD;
  [1]: https://www.smithsonianmag.com/smithsonian-institution/smithsonian-releases-28-million-images-public-domain-180974263/&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2020-03-06at9.47.27AM.png&amp;amp;userId=11733&#xD;
  [3]: https://3d.si.edu/object/3d/mammuthus-primigenius-blumbach:341c96cd-f967-4540-8ed1-d3fc56d31f12&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2020-03-06at10.37.24AM.png&amp;amp;userId=11733&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=esgasd4q3Untitled.png&amp;amp;userId=11733&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=fdsfsdfsdfs.png&amp;amp;userId=11733&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=gfxgfdtey35Untitled.png&amp;amp;userId=11733&#xD;
  [8]: https://3d.si.edu/object/3d/command-module-apollo-11:d8c6457e-4ebc-11ea-b77f-2e728ce88125&#xD;
  [9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2020-03-06at10.14.41AM.png&amp;amp;userId=11733&#xD;
  [10]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2020-03-06at10.25.19AM.png&amp;amp;userId=11733</description>
    <dc:creator>Vitaliy Kaurov</dc:creator>
    <dc:date>2020-03-06T05:56:34Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1184495">
    <title>Mathematica 11.2 Release</title>
    <link>https://community.wolfram.com/groups/-/m/t/1184495</link>
    <description>[![enter image description here][1]][27]&#xD;
&#xD;
Mathematica 11.2 is now available! This latest version expands Mathematica&amp;#039;s cutting-edge functionality in audio and image processing, mathematical computation and machine learningplus much more. Here are some of the highlights:&#xD;
&#xD;
**Audio and Image Processing**&#xD;
&#xD;
 - Generate spoken audio in different voices with [SpeechSynthesize][2]&#xD;
 - The [Audio][3] framework now has stereo support, programmatic playback and&#xD;
   new [AudioStream][4] objects&#xD;
 - Alter one image to look more like another with [ImageRestyle][5]&#xD;
 - Use [CurrentScreenImage][6] or [CurrentNotebookImage][7] to capture the current&#xD;
   screen or notebook&#xD;
 - Generate 2D and 3D raster images from geometric regions with&#xD;
   [RegionImage][8]&#xD;
 - Retrieve satellite images of a geographic area with [GeoImage][9]&#xD;
&#xD;
**Mathematical Computation**&#xD;
&#xD;
 - [Limit][10] can now calculate undirected, nested and multivariate limits&#xD;
 - [RSolveValue][11] and [DSolveValue][12] can now compute limiting values directly&#xD;
 - Additional functions and operators for calculating limits: [MinLimit][13],&#xD;
   [MaxLimit][14], [DiscreteLimit][15], etc.&#xD;
 - Support for 3D Boolean operations through [RegionUnion][16],&#xD;
   [RegionIntersection][17], etc.&#xD;
&#xD;
**Machine Learning**&#xD;
&#xD;
 - [Classify][18] and [Predict][19] have new training methods, built-in models,&#xD;
   progress reporting and [TimeGoal][20] for limiting training times&#xD;
 - New feature types for extracting audio, sequences and word vectors&#xD;
   from data&#xD;
 - [WMLF][21] and [MXNet][22] formats for import/export of neural networks and other&#xD;
   machine learning models&#xD;
 - Expanded options and methods for various neural network layer types&#xD;
&#xD;
Version 11.2 also includes a number of new import/export formats, interpreter types and low-level performance optimizations. Programming is more flexible than ever with new functionality for [initialization][23], [background tasks][24] and [network programming][25], as well as new interfaces for [external interpreted languages][26].&#xD;
&#xD;
For more details about these and other new additions, read through Stephen Wolfram&amp;#039;s [launch-day blog post][27] and take a look at the [Summary of New Features in 11.2][28]. &#xD;
&#xD;
[![enter image description here][29]][27]&#xD;
&#xD;
&#xD;
[![enter image description here][30]][27]&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=112-wordcloud.png&amp;amp;userId=11733&#xD;
  [2]: http://reference.wolfram.com/language/ref/SpeechSynthesize&#xD;
  [3]: http://reference.wolfram.com/language/ref/Audio&#xD;
  [4]: http://reference.wolfram.com/language/ref/AudioStream&#xD;
  [5]: http://reference.wolfram.com/language/ref/ImageRestyle&#xD;
  [6]: http://reference.wolfram.com/language/ref/CurrentScreenImage&#xD;
  [7]: http://reference.wolfram.com/language/ref/CurrentNotebookImage&#xD;
  [8]: http://reference.wolfram.com/language/ref/RegionImage&#xD;
  [9]: http://reference.wolfram.com/language/ref/GeoImage&#xD;
  [10]: http://reference.wolfram.com/language/ref/Limit&#xD;
  [11]: http://reference.wolfram.com/language/ref/RSolveValue&#xD;
  [12]: http://reference.wolfram.com/language/ref/DSolveValue&#xD;
  [13]: http://reference.wolfram.com/language/ref/MinLimit&#xD;
  [14]: http://reference.wolfram.com/language/ref/MaxLimit&#xD;
  [15]: http://reference.wolfram.com/language/ref/DiscreteLimit&#xD;
  [16]: http://reference.wolfram.com/language/ref/RegionUnion.html&#xD;
  [17]: http://reference.wolfram.com/language/ref/RegionIntersection.html&#xD;
  [18]: http://reference.wolfram.com/language/ref/Classify&#xD;
  [19]: http://reference.wolfram.com/language/ref/Predict&#xD;
  [20]: http://reference.wolfram.com/language/ref/TimeGoal&#xD;
  [21]: http://reference.wolfram.com/language/ref/format/WMLF.html&#xD;
  [22]: http://reference.wolfram.com/language/ref/format/MXNet.html&#xD;
  [23]: http://reference.wolfram.com/language/guide/InitializationAndProvisioning.html&#xD;
  [24]: http://reference.wolfram.com/language/guide/BackgroundAndScheduledTasks.html&#xD;
  [25]: http://reference.wolfram.com/language/guide/NetworkProgramming.html&#xD;
  [26]: http://reference.wolfram.com/language/guide/ExternalInterpretedLanguageInterfaces.html&#xD;
  [27]: https://wolfr.am/launching-11-2&#xD;
  [28]: http://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn112.html&#xD;
  [29]: http://community.wolfram.com//c/portal/getImageAttachment?filename=InOutImg82.png&amp;amp;userId=11733&#xD;
  [30]: http://community.wolfram.com//c/portal/getImageAttachment?filename=InOutImg91.png&amp;amp;userId=11733</description>
    <dc:creator>Brian Wood</dc:creator>
    <dc:date>2017-09-14T18:59:23Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1732766">
    <title>[WSC19] Parse what is happening in a videogame from images</title>
    <link>https://community.wolfram.com/groups/-/m/t/1732766</link>
    <description>After a full 30 mins of some very intellectual talk with Mr.Stephen Wolfram, shortened my Final Project choice list from 7 to just 2. I decided to go with one of the weirdest projects in my list which was Parsing Details from Video Game footage.&#xD;
&#xD;
Now the topic literally made me infer to teach the computer how to understand the game it is showed but Mr. Stephen Wolfram thought it was maybe too easy, I agreed so we both got excited on the practical approach of the project, which was to make a computer algorithm that fully understands a footage given to it and makes a speech output of some key details in such a way that a Visually Impaired person was able to understand and play if the algorithm was to be running realtime.&#xD;
&#xD;
&#xD;
&#xD;
 While working on my project at the program I got to understand the realm of image processing in great detail. Now since image processing is comparatively hard in other languages, it became one of my greatest fears and thus I got a chance to battle it with Mathematica.&#xD;
&#xD;
The trajectory of this project kinda changed when I had a one on one with Mr. Stephen Wolfram, He suggested me to make the Computer understand each frame in such detail that even a blind person can understand it and thus It gave me an Idea on shifting my Project&amp;#039;s Purpose from Simply annotation to Analyzing and Pre to Post-processing details.&#xD;
&#xD;
The idea was to use the annotation procedure to analyze the scenario of the game and give out Audio Response (One of the Layers of Output)&#xD;
&#xD;
Among the 3 layers of outputs, the graphical visualization of the processes of the project looked like this:&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
&#xD;
&#xD;
I began working by first making the game myself on my favorite Game engine UNITY, check it out here and after that, I collected a few screenshots and Videos footages from the game.&#xD;
&#xD;
&amp;gt; The Reason I made the Game myself on Unity was to use the&#xD;
&amp;gt; UnityConnect[ ] in Mathematica, However for a few reasons was not&#xD;
&amp;gt; possible, I would use it later though&#xD;
&#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
&#xD;
The first thing to be done was to make the computer read any useful details that may change the game&amp;#039;s state. Among them, &amp;#034;Ready!&amp;#034; and&amp;#034;Game Over&amp;#034; were a few of the Messages that halted the game until the user moves the sprite again.&#xD;
&#xD;
To start TextRecognition on this image above I first had to remove all the layers extra detail from the footage that distorted the result of the text recognition.&#xD;
&#xD;
Definitely, it was the grid behind it, I used ColorDetect on the Green color channel of the Image and deleted that which gave me a result like this:&#xD;
&#xD;
![enter image description here][3]&#xD;
&#xD;
After Reversing the colors for a better view I applied the text recognize function and got a stable result. Now that we have found the halting point of the code we could skip these frames for program efficiency. &#xD;
&#xD;
I nested this to an entire Function and along with that I defined a few more Custom Functions that made my code a bit easier to debug.&#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
Before we Continue,  A little Custom Functions.&#xD;
&#xD;
**My Custom Function LegacyTracker[ ]**&#xD;
&#xD;
    LegacyTracker[image_, clr_, disp_, imp_] := (                                                          \&#xD;
    &#xD;
      pixelize = &#xD;
       PixelValuePositions[&#xD;
        ColorNegate[Binarize[ColorDistance[image, clr], imp]], &#xD;
        1];                                    &#xD;
      dop = CoordinateBounds[&#xD;
        pixelize];                                                        \&#xD;
    &#xD;
      If[disp == True, &#xD;
       Show[image, &#xD;
        Graphics[{EdgeForm[{Thick, Green}], Opacity[0], &#xD;
          BoundingRegion[pixelize, &amp;#034;MinRectangle&amp;#034;]}]], dop]  &#xD;
      )    &#xD;
&#xD;
         &#xD;
Tracks Keyed Color and return the specific keyed data from the image argument inform of an Image or Coordinates. &#xD;
&#xD;
**My Custom Function LegacyTrackerMasker[ ]**&#xD;
&#xD;
    LegacyTrackerMasker[image_, clr_, disp_, imp_] := (&#xD;
      pixelize = &#xD;
       PixelValuePositions[&#xD;
        ColorNegate[Binarize[ColorDistance[image, clr], imp]], 1];&#xD;
      dop = CoordinateBounds[pixelize];&#xD;
      If[disp == True , &#xD;
       Show[image, &#xD;
        Graphics[{EdgeForm[{Thick, White}], Opacity[1], &#xD;
          BoundingRegion[pixelize, &amp;#034;MinRectangle&amp;#034;]}]], dop]&#xD;
      )&#xD;
&#xD;
Masks the Keyed Color to Black in order to Perform Efficient tracking on similar Color key data&#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
I first used this function to Track the yellow life bars in the Game HUD and cropped out the middle row of the image and simply read the Pixel Values and counted each time a yellow group of pixels appeared to determine the number of lives the player has and&#xD;
&#xD;
save them to the main String which would be narrated to you each time you died.&#xD;
&#xD;
    f = LegacyTracker[&#xD;
    LegacyTrackerMasker[footage, RGBColor[0/255, 128/255, 248/255], &#xD;
    True, 0.1], Yellow, False, 0.1];&#xD;
    tst = ImageTrim[&#xD;
    footage, {Take[f, 1][[1]][[1]], &#xD;
    Take[f, 2][[2]][[1]]}, {Take[f, 1][[1]][[2]], &#xD;
    Take[f, 2][[2]][[2]]}];&#xD;
    {c, r} = ImageDimensions[tst];&#xD;
    ImageTake[RemoveAlphaChannel[tst], {Round[r/2]}, {1, c}];&#xD;
    count = Length[&#xD;
    Flatten[Length /@ Split [#] &amp;amp; /@ &#xD;
    ImageData[&#xD;
    ImageTake[RemoveAlphaChannel[tst], {Round[r/2]}, {1, c}]]]];&#xD;
    If[count == 7, MainStr &amp;lt;&amp;gt; &amp;#034; ,&amp;#034; &amp;lt;&amp;gt; &amp;#034;3 Lives Remaining&amp;#034;, &#xD;
    If[count == 5, MainStr &amp;lt;&amp;gt; &amp;#034; ,&amp;#034; &amp;lt;&amp;gt; &amp;#034;2 Lives Remaining&amp;#034;, &#xD;
    If[count == 3, MainStr &amp;lt;&amp;gt; &amp;#034; ,&amp;#034; &amp;lt;&amp;gt; &amp;#034;1 Life Remaining&amp;#034;, &#xD;
    MainStr &amp;lt;&amp;gt; &amp;#034; ,&amp;#034; &amp;lt;&amp;gt; &amp;#034;Game Over&amp;#034;]]]&#xD;
    If[SecStr == &amp;#034;Ready!&amp;#034;, SpeechSynthesize[MainStr]]&#xD;
&#xD;
&#xD;
After this, I inverted the Previous mask and cropped the grid out and removed all the HUD elements since the have been analyzed for the frame. After that, I ran the Trackers again but now on ghosts for Calculating the angle vectors with respect to Pac-Man for processing the direction they are headed towards and if they were are a safe distance or not. &#xD;
&#xD;
    abt = False;&#xD;
    coordEnemyRed = N[Mean[LegacyTracker[a, Red, abt, 0.4]]];&#xD;
    coordEnemyCyan = N[Mean[LegacyTracker[a, Cyan, abt, 0.4]]];&#xD;
    coordEnemyYellow = &#xD;
      N[Mean[LegacyTracker[a, RGBColor[255/255, 201/255, 51/255], abt, &#xD;
         0.1]]];&#xD;
    coordEnemyPink = &#xD;
      N[Mean[LegacyTracker[a, RGBColor[255/255, 153/255, 204/255], abt, &#xD;
         0.03]]];&#xD;
    coordPacMan = N[Mean[LegacyTracker[a, Yellow, abt, 0.2]]];&#xD;
&#xD;
&#xD;
I took the mean since it gave me the center of the image which I later was used for calculating the vector angle of the Ghosts with respect to Pac-Man which later was mapped out to give the direction the ghosts were at.&#xD;
&#xD;
&#xD;
&#xD;
    distance = &#xD;
     Min[N[EuclideanDistance[coordPacMan, coordEnemyCyan]], &#xD;
      N[EuclideanDistance[coordPacMan, coordEnemyYellow]], &#xD;
      N[EuclideanDistance[coordPacMan, coordEnemyPink]], &#xD;
      N[EuclideanDistance[coordPacMan, coordEnemyRed]]]&#xD;
&#xD;
&#xD;
Later, I Calculated the distance between the points and the Mean point of the enemy Mobs that ultimately decided which enemy is most probably a threat to you at the moment and accordingly the program uses a speech synthesizer to produce an output.&#xD;
&#xD;
After the Ghosts, the next thing to detect was the maze, for which I first applied a series of filters to the Cropped Image of the grid (Maze)&#xD;
&#xD;
    ColorNegate[&#xD;
     ColorReplace[&#xD;
       ColorNegate[&#xD;
        ColorDetect[FinCrp, RGBColor[0/255, 128/255, 248/255]]], &#xD;
       LightGray] // Normal]&#xD;
&#xD;
This ultimately gave me the output like this:&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
After this, I took the PixelValue position of the White bits and coded a construct that immediately makes a pop sound whenever the Pac-Man hits a wall.&#xD;
&#xD;
Now the next thing I did was to store the coordinates of Pac-man to a List which took a history of the movement and using the existing list data and the Maze pixel values, Calculated above, The computer found probable ways for the Sprite to go and if a way was hazardous for the sprite it would also produce an output. &#xD;
&#xD;
In similar, all the constructs work in Parallel on passes frame(s) and completely annotates it all. &#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
At this time the Program is indeed not real-time thus ill be working on this to make it process in the background by connecting my Pacman game with UnityLink and Mathematica. A lot of development yet remains in this project but the prime goal to parse the detail from a frame has been achieved.&#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
As for my future work, I would actually like to work my way towards the accessibility computing and would take this project of mine to a much-advanced level where it actually does all of this in Real-time while producing using music as a key component to communicate with the player.&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
Important Links:&#xD;
 &#xD;
[Project Source Code][5]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=FF.png&amp;amp;userId=1720422&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=1.PNG&amp;amp;userId=1720422&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=image.png&amp;amp;userId=1720422&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=aaaa.png&amp;amp;userId=1720422&#xD;
  [5]: https://github.com/n43ee7/WSS-Final-Project</description>
    <dc:creator>Nabeel Nayyar</dc:creator>
    <dc:date>2019-07-12T01:36:08Z</dc:date>
  </item>
</rdf:RDF>

