How to use Excel solver to optimize coefficients in a classification problem?

57 Views Asked by At

For a binary image-analysis task, I've used a convolutional neural network (CNN) to analyze images at different scales. The objective is to determine whether an image is the work of a particular artist -- say, Rembrandt. I use 20 test images, 10 Rembrandts and 10 non-Rembrandts, and analyze them with the CNN at different scales. So if there are 10 different scalings, I have a 20 x 10 matrix of values. Each matrix value $M_{i,j}$ is the probability value assigned by the CNN to the painting $i$ at scaling $j$, with values over 0.5 corresponding to a Rembrandt classification.

What I'm trying to do is find coefficients for each scaling level (matrix column) that minimize the overall error -- i.e., the fewest misclassified paintings. For each painting (matrix row), the overall classification probability $p$ is the sum of the products of the probabilities found for each scaling level multiplied by the coefficient for that level, i.e., for painting $i$ and coefficients $c_0 ... c_{9}$,

$$p_i = \sum_{j=0}^9 c_jM_{i,j}$$

The coefficients can range from 0 to 1 and sum to 1. For each row $i$ we know whether a correct classification has $p_i$ above or below 0.5, so we can use these labels as soft constraints.

Not sure how to set up an optimization problem like this in Excel -- it doesn't conform to any type of problem I've worked with or seen.