marco-c / autowebcompat

Automatically detect web compatibility issues
Mozilla Public License 2.0
35 stars 41 forks source link

[WIP] Testing VGG19, VGG16, and VGG-like (from scratch versions) #207

Closed sdv4 closed 5 years ago

sdv4 commented 6 years ago

Will include testing various parameters for the architecture, and labelling more images.

sagarvijaygupta commented 6 years ago

You must change VGG19 model to

def create_vgg19_network(input_shape):
    base_model = VGG19(input_shape=input_shape)
    return Model(input=base_model.input, output=base_model.get_layer('fc2').output)

There was some unseen error in saving of models. I will create a PR for this shortly.

codecov-io commented 6 years ago

Codecov Report

Merging #207 into master will increase coverage by 1.3%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #207     +/-   ##
=========================================
+ Coverage    20.8%   22.11%   +1.3%     
=========================================
  Files          11       11             
  Lines        1216     1126     -90     
  Branches      160      148     -12     
=========================================
- Hits          253      249      -4     
+ Misses        961      875     -86     
  Partials        2        2
Impacted Files Coverage Δ
autowebcompat/network.py 27.85% <0%> (-1.4%) :arrow_down:
collect.py 0% <0%> (ø) :arrow_up:
label.py 0% <0%> (ø) :arrow_up:
train.py 0% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0aded3e...94e6155. Read the comment docs.

sdv4 commented 6 years ago

@sagarvijaygupta I made that change now, thanks!

marco-c commented 6 years ago

@sdv4 are you labeling with bounding boxes too? It is optional, but it would be better as it would give us more information about the incompatibilities.

sdv4 commented 6 years ago

@marco-c Yes, I will do that. Just fyi: the first run resulted in validation accuracy of 91.19% after the first epoch, with no improvement by the fourth epoch when I killed the process (was just running locally on my machine).

marco-c commented 6 years ago

@sdv4 could you split the labeling into a separate PR, so we can merge it?

marco-c commented 6 years ago

And we should look at the confusion matrix, that percentage looks too good to be true!

sdv4 commented 6 years ago

@marco-c Will do!

As for the accuracy percentages, were you expecting them to be much lower because the networks aren't using the ImageNet weights? How should I go about investigating this further?

marco-c commented 6 years ago

As for the accuracy percentages, were you expecting them to be much lower because the networks aren't using the ImageNet weights?

I was pessimistic, the problem is not so easy so I was expecting some tuning to be needed.

How should I go about investigating this further?

@sagarvijaygupta added support for outputting the confusion matrix, the first step would be to retrain with one of the networks and see what the confusion matrix looks like.

sdv4 commented 6 years ago

@marco-c I did include the output confusion matrices:

VGG19: [[136 39] [ 26 215]]

VGG16: [[142 61] [ 22 191]]

Is this what you were referring to?

marco-c commented 6 years ago

Is this what you were referring to?

Yes, sorry, I had missed them, that issue was getting too long :P They don't look too imbalanced!