简体   繁体   中英

adding multiple metadata to tflearn CNN

I'm using CNN for (medical) image analysis and prediction, using the typical CNN. I added one set of metadata to the CNN network like this and it seems to work: network = input_data(shape=[..],..) metadata_1 = input_data(shape=[..],..)

network = <convolutions and some max pooling>
network = fully_connected(network, 100,..>
network = merge (network, metadata_1)
network = fully_connected ()
...

Now, could i extend this to do this? Anyone has any experience? and pitfalls?

network = input_data(shape=[..],..)
metadata_1 = input_data(shape=[..],..)    
...
metadata_n = input_data(shape=[..],..)
network = <convolutions and some max pooling>
network = fully_connected(network, 100,..>
network = merge (network, metadata_1)
...
network = merge (network, metadata_n)
network = fully_connected ()
...

Thanks in advance.

I think you're talking about layer concatenation here. At least that's what I used in my CNNs.

Now in your case you're adding metadata into consecutive layers n-times. This produces n extra layers, which can become memory intensive. What I find more intuitive is to use concat layer and concatenate conv and all metadata layers together.

network = <convolutions and some max pooling>
network = fully_connected(network, 100,..>  
network = concat (network, metadata_1, metadata_2, ..., metadata_n)
network = fully_connected ()
...

You might get different results with your approach, but I suspect there won't be much difference. If you want to know you should try both.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM