98

Here is one example using a convolutional neural network (CNN) to crack the CAPTCHA. We will use a CAPTCHA library to generate sample CAPTCHA images and then train a neural network to decode these images. The trained network can be downloaded from crack_CAPTCHA.wlnet. In the following, we will describe how to prepare the training data, construct and train ...


55

I have worked in pattern classification and machine learning for decades, taught the subject in a number of elite academic departments, am writing the third edition of Pattern classification by Duda, Hart and Stork as well as its companion computer manual in Mathematica, and am an expert Mathematica programmer, a solid Matlab programmer, but very weak in R ...


55

Introduction An object detection problem can be approached as either a classification problem or a regression problem. As a classification problem, the image is divided into small patches, each of which will be run through a classifier to determine whether there are objects in the patch. Then the bounding boxes will be assigned to locate around patches that ...


48

Mathematica doesn't have the depth of algorithm support that is present in R or Python. Julia has much more limited algorithm support but does exhibit a good turn of speed. The few algorithms that Mathematica does support are not particularly well exposed for the type of tweaking needed to win Kaggle competitions. Mathematica, as of version 10, supports ...


38

Indeed, this functionality still exists, but it has been moved into its own package. Load the package: Needs["aBetterProgrammer`"] You will have access to such functions as GimmeDaCodez (answers any nebulous MMA.SE question by guessing the unspoken needs of the asker) WizardForm (an output wrapper; produces perfectly terse code; all function calls are ...


37

Thank you for your summary. I would like to clarify and correct a few of your points. however, Mathematica - being proprietary - does not make it clear as to which algorithms they choose to use to implement their network layers. Therefore I honestly am not sure of the some of these layers' underpinnings. We use the same definitions as all the other ...


36

This is actually a useful question, because it gives an opportunity for us to communicate with the community about what is coming, so we can get feedback. So here is some preliminary information about our plans (subject to change, of course). First, we'll have the concept of a sequence of things (e.g. sequence of vectors, sequence of matrices, sequence of ...


32

As was correctly noted in comments, out-of-focus images cannot been correctly detected by a simple gradient filter since out-of-focus images can have sharp edges. I propose another simple idea to detect such images. Introduction Roughly speaking, the brightness of a defocused image $B(x,y)$ is a convolution of a focused image $B_0(x',y')$ with some kernel $...


29

I wrestled with this for a while and got some kind of results, but nowhere near the great performance for which GANs are famous. Ultimately, they're absurdly sensitive to hyperparameters and initialization, and if you don't exactly imitate the published settings, you are unlikely to get good results. I figure I should post my attempt -- maybe the community ...


27

It seems the model file in MXNet (checkpoint) is defined by two files: a ".json" file and a ".params" file. The json file contains the definition of the network, and the params file contains the actual weight and bias of each neuron. The params file is in the binary format of MXNet's NDArray representation. Thus, to export a network in Mathematica to MXNet, ...


26

What you're describing is Topic modeling. Your link describes Latent Dirichlet Allocation (LDA), which is a popular model. You mention that you would like to use an expectation-maximization algorithm to implement the LDA model (through variational inference). That is, however, only one of many approaches to the necessary parameter estimation. Another is ...


26

Can anyone explain the source of this bias and how I might go about fixing it? The source of the bias is the low number of features used to grow the trees (mtry in R). Both R and Mathematica currently use Max[1, Floor[number of features/3]] as the heuristic for choosing this number (Mathematica might change this in the future). As your data has 5 features, ...


26

Sebastian mentioned in his answer that deepdream can be possible using NetDerivative. Here are my attempts following his outlines. Instead of using the inception model, I'm using VGG-16 here for simplicity. Inception model allows arbitrary image size, but may need some extra normalization steps. The MXNet version of the VGG model can be downloaded from ...


24

If you want to have a description of the method used by a given ClassifierFunction you can do: ClassifierInformation[myclassifier, "MethodDescription"] Also, the methods used are quite classic, so you can easily find documentation on the web. If you want to know why Classify uses a given model there is a simple answer: Classify tries to find the model ...


24

It's on our list of things to do, but there are many other areas we want to cover, such as custom feature functions, customizable feature selection, boosting, NLP, deep learning of neural networks, convolutional nets, GPU acceleration, and so on. Until then, your only real solution is to deploy your trained classifier as an API function. Some simpler ...


22

Since version 11 most commands finally support the Interpretation option: Interpretation -> "Literal" being the classical (default) way of operation, and Interpretation -> "Guess" using advanced machine learning to get much better results than ReadProgrammerIntentions ever achieved. Makes programming a lot easier. You can emulate the old behavior with ...


22

I tend to use a pattern matching approach: myCode/.{x_?BugQ:>BugStrip[x],x_?TypoQ:>Detypo[x],x_?WrongSignQ:>-x,x_?OffBy2PiQ:>x*2\[Pi]} With the usual caveat that pattern matching can be slower than other methods, but conceptually easier to understand. Hopefully someone will aggregate the answers to compare performance. Good luck!


21

As of Version 10 , Mathematica has a built in function Classify, which implements support vector machines and some other common machine learning algorithms. trainingset = {1 -> "A", 2 -> "A", 3.5 -> "B", 4 -> "B"}; classifier = Classify[ trainingset, Method -> "SupportVectorMachine"];


21

The Mathematica Journal has a nice article on SVM's: A Flexible Implementation for Support Vector Machines, with an accompanying notebook and .m file providing an SVM implementation.


21

You can pass the undocumented option "ShowTrainingProgress" -> False to turn off the training progress blob thing. As for monitoring the progress yourself, there is a feature coming in 11.1 called Checkpointing that lets you specify a callback to every so often that gets access to the partially trained net. You WOULD use it like so: NetTrain[ ..., ...


20

Edit The use of two median filters is the bottleneck of my method, and you indicated in a comment on nikie's answer that speed might be of importance to you. You can replace MedianFilter[] by TotalVariationFilter for essentially the same results, but a 10x speed-up, as below. For images where the background is less variable, or the noise is less, you ...


20

Maybe you can transform this into an easier problem: If you were instead looking for lines that are at any point perpendicular to your vector field: (that's easy, it's just a coordinate transformation) and if your (transformed) vector field were the gradient of a scalar field (yes, big if), then this would be really easy: These lines are simply the level ...


20

If you have an inception model, its mostly possible using hidden functionality (but without GPU training). The steps would look like this: Cut the inception model at some level using Take. Then add a Ramp (or other) positive activation and SummationLayer: DeepDream simply wants to maximize the total amount of neuronal firing at the last layer (the original ...


19

Layers BatchNormalizationLayer There are several layers introduced in v.11 that can not be used uninitialized, this is one of them. Input must be either a rank 1 or rank 3 tensor. To be honest, I do not think we can see its true effect on one input as demonstrated by these two examples below. I believe the effect of Batch normalization is only implemented ...


18

The biggest issue you are running in to is that you have to recompute the density estimates each time you sample a new point. You need the estimators to be pre-evaluated. data1 = RandomVariate[ MultinormalDistribution[{-1.5, 0}, {{2, 0}, {0, 1}}], {10}]; data2 = RandomVariate[ MultinormalDistribution[{1.5, 0}, {{2, 0}, {0, 1}}], {10}]; I have a ...


18

The Experimental function FindFormula[] at the moment is using a combination of different methods: it combines non linear regression with Markov chain Monte Carlo methods (e.g. Metropolis–Hastings algorithm). In the future (possibly in V$10.3$) there will be an option allowing the user to choose which method to use.


18

General remarks I am not aware of built-in functions for retrieval of the variable importance from/with Classify and related functions. I implemented (and documented) a package that provides such a function -- see VariableImportanceByClassifiers.m. I have described the algorithm for determining the variable importance in this blog post: "Importance of ...


18

Here's the code. What I mentioned in the Q&A session is using ReshapeLayer to turn the input vector into a 1-channel, flat tensor that ConvolutionLayer can operate on, not to actually use images, per se. I've limited things here just to the original industries, but you can try more if you want. Downloading takes a while, so I have an Export there you ...


18

This function was deprecated in V4.2, being succeeded by CellularAutomaton. Since your answer is hidden somewhere in rules like 110, why reinvent the wheel with ReadProgrammerIntentions?


18

1 - Summary of a simple solution In this particular DIGIT case there is a very simple solution based on neural nets (NNs)trained on MNIST Data. It is just a few lines of code: i=Import["https://i.stack.imgur.com/LC2c2.png"]; imageGRID = ImagePartition[i, Scaled[1/22]]; lenet = NetModel["LeNet Trained on MNIST Data"]; test[x_] := If[ImageDistance[imageGRID[[...


Only top voted, non community-wiki answers of a minimum length are eligible