Semantic Label Sharing for Semi Supervised with large

40
Semantic Label Sharing for SemiSupervised Learning with large datasets Héctor Jiménez Bernal Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology Universitat Politècnica de Catalunya A thesis submitted for the degree of Telecommunications Engineering Degree 2011 December

Transcript of Semantic Label Sharing for Semi Supervised with large

Page 1: Semantic Label Sharing for Semi Supervised with large

 

 

 

Semantic Label Sharing for Semi‐Supervised Learning with large datasets 

  

 

Héctor Jiménez Bernal 

Computer Science and Artificial Intelligence Laboratory 

Massachusetts Institute of Technology 

Universitat Politècnica de Catalunya  

 A thesis submitted for the degree of 

 Telecommunications Engineering Degree

2011 December 

Page 2: Semantic Label Sharing for Semi Supervised with large

‐2‐

Índice 

Agradecimientos 3

Resumen 4

Contexto 7

Semi‐SupervisedLearning 8

SemanticLabelSharing 10

Distanciasemántica 10 Afinidadsemántica 11 Extensiónmulticlase 11

Experimentación 13

ExperimentosdeRe‐ranking 14 ExperimentosdeClasificación 18

Aprendizajeautomáticoonline 21

Conclusiones 24

Bibliografía 25

Anexo:SemanticLabelSharingforLearningwithManyCategories 27(IEEEEuropeanConferenceonComputerVision2010)

 

Page 3: Semantic Label Sharing for Semi Supervised with large

Agradecimientos

Page 4: Semantic Label Sharing for Semi Supervised with large

Resumen

etiquetado con ruido

Page 5: Semantic Label Sharing for Semi Supervised with large
Page 6: Semantic Label Sharing for Semi Supervised with large

‐6‐

Los resultados de este proyecto, realizado en colaboración con los profesoresRob Fergus de la New York University, YairWeiss de la HebrewUniversity, yAntonioTorralbadelMassachusettsInstituteofTechnology,fueronpresentadosa la European Conference on Computer Vision (ECCV), donde se publicó elartículocorrespondienteenSeptiembrede2010.

Page 7: Semantic Label Sharing for Semi Supervised with large

‐7‐

Contexto 

Históricamente, se han utilizado diferentes esquemas de reconocimiento de lainformación disponible en Internet con el objetivo de reordenar o refinar losresultadosarrojadosporlosmotoresdebúsqueda.Entreotros,seincluyen:Lietal. [8], Fergus et al. [9], Berg et al. [10]. A diferencia de nuestrametodología,estosenfoquestratancadaclaseocategoríademaneraindependienteynoestándiseñados para trabajar eficientemente con losmiles demillones de imágenespresentesenInternet.La compartición de información entre clases es un concepto ampliamenteexploradoenvisiónyaprendizaje,por loqueexistenmuchasópticasdesde lasque abordarla. Algunos de los primeros esquemas utilizados para elreconocimiento de objetos están basados en redes neuronales donde lacomparticiónselogramediantecapasocultascomunesatodaslastareas[11,12].Otros enfoques tratan de transferir información de una clase a otraregularizandolosparámetrosdelosclasificadoresatravésdelasdistintasclases.Torralbaetal.,Opeltetal.[14,15]demostraronsueficaciaenlacomparticiónderasgosclaveentreclasesenelcontextodeboosting.Otrosenfoquestransfiereninformación entre categoríasdeobjetos compartiendoun set comúndepartes[16,17], compartiendo transformaciones a través de diferentes instancias [18‐20], o compartiendo un set de prototipos [21]. Sin embargo, todos estosenfoquestrabajanconrelativamentepocasclases.Másaún,noesevidentecómoestastécnicaspodríanfuncionarcongrandesbasesdedatosconmilesdeclases.

ElmodelodeSemanticLabelSharingsediferenciade losanterioresenqueenésteseimponelacomparticióndeinformaciónenlaspropiasetiquetasenlugardeenparámetrosorasgosdelmodelo.Porconsiguiente,seconsigueunenfoqueindependientedelclasificadorseleccionado.

 

Page 8: Semantic Label Sharing for Semi Supervised with large

‐8‐

Semi‐supervised Learning 

Semi‐Supervised Learning (SSL) es un planteamiento eficaz en un contextodonde se dispone de pocos ejemplos de entrenamiento puesto que la propiadensidad de los datos puede usarse para regularizar la solución. Esto permitepaliar los efectos de over‐fitting por la utilización de pocos ejemplos deentrenamiento y, en consecuencia, obtener mejores soluciones. El método deaprendizaje semi‐supervisado utilizado en este proyecto fue desarrollado porFergus,TorralbayWeiss[26]ysebasaenlautilizacióndelgrafoLaplacianopararealizarposteriormenteunaaproximaciónquereduceeltiempodeaprendizajede polinómico a lineal en el número de imágenes. A continuación describimosbrevementeelesquemadeSSL:Dadaunaclaseocategoría,disponemosdeundatasetdeLimágenesetiquetadas

, , , … , , ,donde correspondealdescriptordelaimagenie aporta la información acerca del etiquetado (tomando valor 1 para losejemplos positivos de la clase en cuestión y 0 para los negativos). TenemosademásunsetUdeimágenessinetiquetar , … , ,parauntotaldeNimágenes. En consecuencia, el objetivo consiste en hallar una función f que, apartirdelaprendizajeenlosparesdeentrenamiento , arrojevaloresparalasimágenessinanotar.

Para ello, creamos un grafo cuyos vértices son las imágenes X (es decir, susdescriptores) y las aristas están modeladas por una matriz ponderada W de

tamañoNxN.Elpesode las aristasquedadefinidopor e / , laafinidad visual entre las imágenes i y j. Definiendo lamatriz diagonalD cuyoselementos son ∑ W obtenemos el grafo Laplaciano normalizado como

D / WD / .EstegrafoLnossirveparamedirlasuavidaddelassolucionesobtenidas en los datapoints , puesto que las soluciones que buscamosdeben ser consistentes con las etiquetas proporcionadas pero también suavesconrespectoalgrafo.Enconsecuencia,elfuncionalaminimizares:

Λ

Donde Λ es unamatriz diagonal cuyos elementos son Λ cuando i es unaimagenanotaday0siesunaimagenporetiquetar.Asípues,observamosqueelprimertérminodelfuncionalcontemplalasuavidaddelasoluciónmientrasqueelsegundovaloralaadecuacióndelamismaalosejemplosdeentrenamiento.

LasoluciónseobtieneresolviendoelsistemalinealNxN Λ Λ ,porloquesenecesitanresolverNecuacioneslineales.ParavaloreselevadosdeN,estoimplica una problemática importante enmateria de tiempo de computación yrobustez. Sin embargo, como se sugiere en [25], la dimensión del problemapuede reducirse significativamente si trabajamos únicamente con un pequeñonúmerodeeigenvectorsdelLaplaciano.

SeanΦ , loseigenvectorsyeigenvaluesdelgrafoLaplacianoL.Cabenotarquela suavidad de un eigenvector Φ essimplementeΦ LΦ σ por lo que los

Page 9: Semantic Label Sharing for Semi Supervised with large

‐9‐

eigenvectorsconmenoreigenvaluesonmássuaves.Puestoquecualquiervectoren puedeescribirsecomo ∑ Φ ,lasuavidaddeunvectoresdirectamente∑ σ .Porello,eslógicopensarquelosvectoressuavesseráncombinacioneslineales de los eigenvectors con eigenvalues pequeños. Ésta es una estrategiacomún[23‐25]paralareduccióndimensionaldelproblema.

Así, podemos reducir la dimensión de f imponiendo que ésta sea de la formaf = , donde U es una matriz N x k cuyas columnas corresponden a los keigenvectorsdeLconmenoreigenvalue.Conestaaproximación,el funcionalaminimizarqueda

Σ Λ

siendoΣlamatrizdiagonalconloskeigenvaluesmenores.Loscoeficientes seobtienenmediante la resolucióndel sistema linealk xk Σ Λ Λ .En estas condiciones, dados los eigenvectors el grafo Laplaciano puederesolverse el problema semi‐supervisado en un espacio dimensional reducido.Sin embargo, es necesario hallar en primer lugar los eigenvectors por lo quedebe diagonalizarse la matriz L, de dimensiones NxN, un problema cuyacomplejidaddecálculoes ,completamenteinabordablecuandoelnúmerodeimágenesnoetiquetadascrecehastalos11millones.

Dada esta problemática, Fergus, Torralba y Weiss introducen en [26] unesquema eficiente para calcular aproximaciones de los eigenvectors de L entiempo .Estaaproximaciónradicaenlaformulacióndelproblemacontinuo(en el caso en que → ∞ y el consiguiente cálculo de aproximacionesnuméricasdeloseigenfunctions(límitedeloseigenvectorsparaelcasoinfinito).Acontinuaciónseobtienenloseigenvectorsaproximadosmedianteunaseriedeinterpolaciones unidimensionales de los eigenfunctions numéricos. Loseigenvectorsaproximadosresultantes(ysuseigenvaluesasociados)seusanensustitución de yΣ para la obtención de los coeficientes de la funciónsolución. 

 

Page 10: Semantic Label Sharing for Semi Supervised with large

‐10‐

Semantic Label Sharing 

Distancia semántica  Conelobjetivodeobtenerunamedidadelasimilaridadodisparidadsemánticaentre diferentes categorías o clases semánticas, a partir del estudio en [22]usamosunárboldefinidoporWordNet[5].WordNetesunagranbasededatosde carácter léxico en lengua inglesa que contemplamultitud de acepciones denombres, verbos, adjetivos y adverbios agrupados en conjuntos de sinónimoscognitivos o synsets, donde cada uno de ellos hace referencia a un conceptodistinto. Cabe destacar que para nuestro proyecto tomamos únicamente lajerarquía referente a sustantivos.PuestoqueWordNet tieneunaestructuradegrafo, centrándonosen la acepciónmás comúnde cadanombreobtenemosunárbol.Laimagensiguientemuestraunsub‐árboldeWordNet.

Definimosladistanciasemántica entrelasclasesiyj(nodosdelárbol)comoelnúmerodenodoscompartidosentrelasdosramasprecedentes,divididoentrelalongituddelaramamáslarga.

#nodoscompartidosentreramasprecendentesmax longitud ramai, ramaj

Enestesentido,puedecomprobarseempíricamentequesecumple lahipotésisdecorrelaciónentresimilaridadvisualysemántica.En elejemplosiguientesemuestra la distancia semántica entre diversas categorías y dos ejemplosseleccionados ("long pants" y "China rose"). En él, puede observarse que lasimilaridad visual entre imágenes de palabras semánticamente cercanas esmayor.

Page 11: Semantic Label Sharing for Semi Supervised with large

‐11‐

Afinidad semántica Acontinuación,seconstruyeunaafinidadsemánticaexponencialAentreclasessegún la fórmula e , donde S es la métrica definida anteriormente.Con esta transformación, se pretende que Aij sea prácticamente 0 cuando lasclasesseanpocoparecidas. Por ejemplo, para la clase "airbus" y una κ = 10, las clases semánticas máscercanas son "airliner" (0.49), "monoplane" (0.24), "dive bomber"(0.24)","twinjet"(0.24),"jumbojet"(0.24),y"boat"(0.03). Confinalidadilustrativa,lasiguienteimagenmuestralamatrizdeafinidadpara10clasesseleccionadasdeWordNet:

 

Extensión Multiclase Para incorporar la noción semántica a la solución original, es necesarioreformularelproblemainicialenuncontextomulticlase. Sea C un set de c clases distintas. Ahora las etiquetas conforman una matrizbinariaY=[Y1, ... ,Yc]dedimensionesnxcydebehallarseunafunciónFtalqueminimiceelfuncional

Λ

CabenotarqueF= [f1, ... ,fc] es la concatenaciónde las soluciones alproblemaunidimensionalparacadaunadelascclases.

En este contexto, la afinidad semántica A será una matriz c x c simétrica.Mediante la sustitución de la matriz de etiquetado Y por Y·A posibilitamos lacompartición de etiquetas entre clases. Esta sencilla operación tiene lossiguientesefectos:

Los ejemplos positivos se copian entre clases, debidamenteponderadossegún su afinidad semántica. Por ejemplo, el vector y de etiquetas para"felisdomesticus"teníapreviamentevalor0paralasimágenesde"tabbycat",peroahoraesoselementospresentanunvalorde0.93.

Sin embargo, las etiquetas de clases no relacionadas sólo se desviaránligeramentedesuvalororiginal0(dependiendodelvalordeκ).

Page 12: Semantic Label Sharing for Semi Supervised with large

‐12‐

LosejemplosnegativosdeclasesfueradelsetCseleccionadonopercibenefectoalguno(puestoquetomanvalor0entodaslascolumnasdeY).

Aunque cada clase tenga solamente unos pocos ejemplos anotados, lamultiplicación por A transmitirá efectivamente ejemplos a través declases semánticamente similares, mejorando considerablemente elnúmerodeejemplosdisponiblespara entrenamiento, siemprey cuandohayaclasessemánticamentesimilaresenelsetC.

Desde otra perspectiva, puede considerarse que éste mecanismo decomparticióntransformaelproblemaoriginaldeclasificaciónenunproblemaderegresión,pueslosvaloresbinariosdeYseconviertenenvaloresrealesenY·A.En consecuencia, pueden adaptarse muchos tipos de clasificadores paraminimizarelerrorderegresiónenlugardelerrordeclasificación.

 

Page 13: Semantic Label Sharing for Semi Supervised with large

‐13‐

Experimentación 

La evaluación de nuestro esquema de compartición se realiza en base a dosobjetivosdistintos:

1. Re‐ranking de imágenes: mejora de la eficacia en las imágenesencontradasporlosbuscadoresdeInternet

2. Clasificacióndeobjetos

Debe notarse que, mientras la primer tarea consiste en un conjunto deproblemasde2clases(p.e.identificaryclasificarlasimágenesde"pony"vs.lasde "no pony"), mientras que el segundo es un problema de clasificaciónmulticlaseenunescenarioconmúltiplescategorías.

Ambastareasserealizanen3datasetsrelativosalabasededatosTinyImages[1],unacolecciónheterogéneayvariabledeimágenesdescargadasdeInternet:

CIFAR:63.000imágenesde126clasespertenecientesalCIFAR‐10dataset[7],unsubsetdeimágenesdeTinyImagesmanualmenteetiquetadas.Cadaclaseestárepresentadapor200ejemplospositivosy300negativos.A continuación, se selecciona un test‐set tomando aleatoriamente 75ejemplos positivos y 150 negativos para cada clase, reflejando así lahabitual SNR (signal‐to‐noise ratio) presente en las imágenes de losmotoresdebúsquedadeInternetyunvalidation‐setde25/50ejemplospositivos/negativos.Finalmente, las 200 imágenes restantes por clase (100 positivas y 100negativas)seutilizaráncomoejemplosdeentrenamiento(training‐set).

Tiny: El dataset de Tiny Images al completo, que contiene 79.302.017imágenes distribuidas en 74.569 clases, las keywords usadas paradescargarlas imágenesdeInternet.Alnohaberetiquetashumanasparaestedataset,usamosensulugarlasetiquetasconruidodelosmotoresdebúsqueda: para cada clase, se asume que las primeras 5 imágenesobtenidas en la búsqueda de cada clase son efectivamente ejemplosverdaderosdelaclase.Asípues,eldatasetpresenta372.845ejemplospositivos(conruido)yelmismonúmerodeejemplosnegativos, seleccionadosaleatoriamentedeltotal de imágenes restantes. Para la evaluación, se utilizan ejemplosanotadosdelosotrosdatasets(CIFARyHigh‐res)

High‐res:Subsetde10.957.654imágenesdeTinyImages,paralascuálesexistelaimagendealtaresoluciónoriginal.Lasimágenescorrespondena53,564 clases diferentes, distribuidas equitativamente entre las clasescomprendidasenTinyImages.Comoeneldatasetanterior,noseutilizanimágenesanotadasmanualmenteyensu lugarsetomancomoejemplospositivos las 5 primeras imágenes de cada clase (y 5 negativosseleccionados aleatoriamente). Para la evaluación, se utilizan 5.357imágenesanotadasmanualmente(2.569positivasy2.788negativas)

Page 14: Semantic Label Sharing for Semi Supervised with large

‐14‐

Paratodoslosdatasets,lasimágenesquedarepresentadaporsudescriptorGistasociado [13]. En los casos de Tiny y CIFAR, se utiliza un descriptor de 384dimensionesposteriormenteproyectadoa32y64dimensionesmediantePCA,paraTinyyCIFARrespectivamente.EnHigh‐Resseutilizaundescriptorde512dimensionesGistproyectadoa48mediantePCA.

Experimentos de Re‐ranking Para el re‐ranking de imágenes usamos primero el CIFAR dataset paracuantificar los efectos del Semantic Sharing. Para cada clase, entrenamosseparadamente un clasificador mediante el training‐set y lo usamos parareordenar las 250 imágenes del test‐set. El clasificador utilizado es elmétodoSSL.A continuación, se muestra el impacto de diferentes estrategias de sharing,mostrandolaprecisiónmediadelas126clasesdelCIFARdatasetparaunrecalldel 15%. El validation‐set se utiliza para seleccionar automáticamente losvalores óptimos para y . Los clasificadores utilizados son Semi‐SupervisedLearning y Nearest Neighbors, respectivamente. La línea punteada indica laprecisiónparaunordenamientoaleatorio(chancelevel).

Como puede observarse en ambos métodos, cuando se utiliza la matriz deWordNet(rojo)seproduceunamejorasignificativarespectoalesquemadenocompartición (verde), esto es, la incorporación de la matriz de afinidadsemánticaWordNetayudaalejercicioderanking.Encontraposición,cuandolamatrizsemánticasetomaaleatoriamente(perofijandolosvaloresenladiagonala1)elresultadoobtenidoespeoralanoutilizacióndelSharing.Finalmente,sitomamoslamatriz"inversa"(reemplazandoApor1‐Ayfijandolosvaloresenladiagonala1),laprecisiónseveclaramenteperjudicada.

En consecuencia, se deduce que la matriz semántica debe reflejar la relaciónentreclasesparaunenfoqueefectivo.Enlafigurasiguientesemuestranalgunosejemplos visuales de re‐ranking, usando el método SSL en conjunción con lamatrizdeafinidadWordNet.

Page 15: Semantic Label Sharing for Semi Supervised with large

‐15‐

Estas son las imágenes de 7 categorías tomadas de las 126 clases del CIFARdataset.Elcontornodecadaimagenindicasuetiqueta(usadaúnicamenteparala evaluación) con respecto a la categoría en cuestión: verde=positivo, rojo=negativo. En la parte superior semuestra el ranking original de las imágenes,mientrasqueenlaparteinferioraparecenlasimágenesre‐rankeadasmediantenuestrométodo, entrenado en las 126 clases con 100 pares de entrenamientoporclase.A continuación, realizamos una exploración sistemática de los efectos delWordNetsharing.ParaesteexperimentofijamoslosvaloresdeyyrealizamosunacomparativadelmétodoSSLconysinelesquemadeSemanticSharing.

EnlasgráficasanterioressemuestralaprecisióndelmétodoSSLenfuncióndelnúmero de clases y pares de entrenamiento utilizados, usando el SemanticSharing en la imagende la izquierda y prescindiendode él en la imagende laderecha, respectivamente. La compartición de información arroja una mejora

Page 16: Semantic Label Sharing for Semi Supervised with large

‐16‐

significativa de la precisión, especialmente cuando existen pocos pares deentrenamientodisponibles.

Elesquemadecomparticiónpuedeutilizarseademásparaaprenderenclasesdelas que no se dispongan ejemplos. En la siguiente gráfica, exploramos cómooperaelmétodocuandonoutilizamosparesdeentrenamientoparaunaclase(laclaseexcluida)ynosvalemosúnicamentede100paresdeentrenamientoparalas125clasesrestantes.

Cuando no se utiliza la matriz de sharing, el performance del método SSLdesciende drásticamente en comparación con el resultado ofrecido cuando sedisponedeparesdeentrenamientoparalaclase,estoes,elpuntoparacadaclaseexcluidacaepordebajodeladiagonal.Sinembargo,cuandoseutilizaelsharing,la caída en performance es relativamente pequeña, con la mayoría de puntosconcentradosentornoaladiagonal.La mejora obtenida por la aplicación del Semantic Sharing la cuantificamos agran escala valiéndonos del High‐Res dataset. El chance level corresponde al2569/(2569+2788)=48%.Sinusarsharing,elSSLpresentaunaperformancemodesta,mientras que la inclusión delWordNet sharing ocasiona unamejorasignificativa.

Page 17: Semantic Label Sharing for Semi Supervised with large

‐17‐

Nuestroexperimentofinalenre‐rankingaplicaelesquemadeSemanticSharingalTinydataset(sinlautilizacióndeetiquetasdeCIFAR).Disponiendode74.569clases,muchaspresentanunagransimilaridadvisual,porloquenuestrométodopuedeayudarconsiderablementeamejorarlareordenación.

Enlafigurasiguientesemuestranresultadoscualitativospara4clasesdistintasdelTinydataset.Paraelexperimento,noseutilizanetiquetashumanasyensulugar se toman como ejemplos positivos las 5 primeras imágenes (según elrankingoriginalenInternet)decadaunadelas74.569categorías.Usandoestasetiquetas, se entrenan los 4 clasificadores en cada una de las clases escogidas("pony","rabbiteyeblueberry","Napoleon"y"pondlily").EnlaprimeracolumnasemuestranlasimágenesordenadassegúnelrankingoriginaldelosbuscadoresdeInternet;enlasegunda,semuestraunareordenaciónmedianteelmétodoSSLsinSemanticSharing;laterceracolumnacorrespondealaaplicacióndelmétodoSSLconSemanticSharing; finalmente, lacuartacolumnamuestrael re‐rankingusandoNearestNeighborsySemanticSharing.

Page 18: Semantic Label Sharing for Semi Supervised with large

‐18‐

Esta figuramuestra cualitativamente que elmétodo SSL con Semantic Sharingclaramente mejora el rendimiento y eficacia de búsqueda respecto al rankingoriginal y que, además, sin la inclusión de lamatriz de sharing los resultadosempeoranconsiderablemente. Cabedestacarque,sinSemanticSharing,elclasificadordisponeúnicamentede5ejemplospositivosdeentrenamientoporclase,porloqueelresultadoespobre.Sinembargo,utilizandoSemanticSharingpuedenutilizarse todos losejemplossemánticamente cercanos del total de 5*74.569 = 372.845 ejemplos positivos.Adicionalmente, el algoritmo SSL tarda aproximadamente 0,1 segundos enrealizarcadare‐ranking(dadoquelaseigenfunctionsestánprecalculadas)vs.1minutoparaelclasificadorNearestNeighbors.

Experimentos de Clasificación  Esencialmente,porclasificaciónentendemoselproblemasegúnelcual,dadaunaimagen, el algoritmo debe predecir a qué clase pertenece esa imagen entre elconjuntodeclasesposibles.Laclasificacióndeimágenesenuncontextoconmuchascategoríasconstituyeunretoenorme.Porejemplo,escogerlaclasecorrectaentre75.000posiblesesunatareaprácticamenteimposibleparalamayoríadepersonas.Asípues,enlugardeusar métricas estándar, decidimos medir cuán lejos la case predicha estárespectoalaclaseverdadera,valiéndonosdelamétricadefinidaporlamatrizdedistancia semántica S. Con esta métrica, dos imágenes de la misma clasepresentandistancia0,mientrasque1indicaunatotaldisimilaridad.

Realizamos una comparativa de nuestro método de Semantic Sharing en elframework de Semi‐Supervised Learning respecto a otras metodologías: (i)SupportVectorMachines(SVM)lineal1‐vs‐ally(ii)SVMjerárquicodeMarszaleky Schmid [27]. El segundo utiliza relaciones semánticas entre clases paraconstruirunajerarquíadeSVMs.Paralaimplentacióndeestemétodo,usamoslamisma estructura de árbol de WordNet de la que se obtiene la matriz dedistancia semántica S. Para cada arista del árbol, entrenamos un SVM linealsegúnelmétododescritoen [27].Cabedestacarquenuestrométodoyel SVMjerárquico disponen de la misma información semántica. En consecuencia, lacomparacióndeambospermiteestudiarcuálrealizaunusomáseficientedelainformaciónsemántica.

Estos tres enfoques se evalúan en CIFAR y High‐Res dataset en las figurassiguientes. Los resultados de ambas claramente demuestran que la adición deinformaciónsemánticaayudaalatareadeclasificación(tantoelSVMjerárquicocomoelSSLconSharingtienenunaperformancemayorquelosotrosmétodos)yque,además,nuestroesquemadeSharingessuperioraldeMarszalekySchmid.

Page 19: Semantic Label Sharing for Semi Supervised with large

‐19‐

EnelCIFARdataset(elmáspequeño)elchancelevelesde1entre126clases.Enestaprimera figuraobervamosqueel errordepredicción, estoes, ladistanciamediadelaclasepredicharespectoalaclaseverdaderadelaimagen,sereduceprogresivamenteamedidaqueaumentaelnúmerodeparesdeentrenamiento.El Sharing SSL presenta unamayor performance (menor error de predicción)quelosotrosmétodos.

En la siguiente figura, se estudia la distribución de las imágenes clasificadassegúnsuerrordeprediccióncuandosedisponede100paresdeentrenamientopor clase,donde la líneaennegrocorrespondeaunaclasificaciónaleatoria, seobserva que el Sharing SSL presenta una distancia semántica mediasignificativamente menor, con una gran masa a una distancia menor que 0,2,implicandounamayorcapacidaddeclasificación.

Page 20: Semantic Label Sharing for Semi Supervised with large

‐20‐

Para el High‐Res dataset, la tarea de clasificación esmás difícil puesto que elchancelevelesde1entre53.564clases.Enlaimagendelaizquierdapodemosobservar que el Sharing SSL es elmétodomás eficaz, al presentar unamenordistanciasemánticamediarespectoa laclaseverdadera.En lasegundagráfica,análoga al CIFAR dataset, observamos que el Sharing SSL tiene una mayorcapacidaddeclasificación(más imágenesclasificadasaunadistancia inferiora0.2)queelrestodemétodos.

 

Page 21: Semantic Label Sharing for Semi Supervised with large

‐21‐

Aprendizaje automático online 

Graciasa losresultadospositivosquearrojaelmétodoSemanticLabelSharingen los experimentos anteriores, decidimos finalizar el proyecto con laimplementación de una aplicación online que tiene por objetivo elreconocimiento y corrección de las categorías semánticas de las imágenesmediante el aprendizaje automático en tiempo real a partir de la informaciónonlineproporcionadaporlosusuarios. LaaplicaciónoperaenlabasededatosHigh‐Resdescritaanteriormente.Trabajacon 10.957.654 imágenes obtenidas del total de Tiny Images, para las cuálesexiste la imagen de alta resolución original. Las imágenes corresponden a untotalde53.564clasesdiferentes.Seencuentraalojadaenlasiguientedirecciónwebhttp://groups.csail.mit.edu/vision/TinyImages/

Laaplicacióntomaporinputlasimágenesetiquetadasporlosusuarios.Cuandoun usuario accede a la página, se muestra un mapa visual de las imágenes,agrupadas en las 53.564 categorías por las cuáles fueron archivadas. Cadacuadrado, asociado a una categoría distinta, muestra el color medio de lasimágenesde la categoríaen cuestión.Cabedestacarque la categoríaen laquecada imagen está catalogada corresponde a la palabra clave por la que fueencontrada en el motor de búsqueda, independientemente de quecorrespondiera o no a esa clase. En definitiva, la aplicación se sirve de lainformaciónproporcionadaporlosusuariosparadecidirsilasimágenesestánonocorrectamentecatalogadas.

Cuandounusuariohaceclicenunaclase, apareceunmenúdesplegableconelnombredelacategoríayladefinicióncorrespondienteenWordNet,asícomounenlace a Wikipedia. Con esta información, se pide al usuario que identifiquecomo ejemplos positivos o negativos de la clase un conjunto de 16 imágenesoriginalmenteclasificadasenesaclase.

Page 22: Semantic Label Sharing for Semi Supervised with large

‐22‐

Estanuevainformaciónseañadealasetiquetasyadisponiblesporlainteraccióndeusuarios anteriores y se ejecuta en tiempo real el algoritmode aprendizajeautomáticoylacomparticióndeetiquetasatravésdelasclases.Pormotivosdeeficiencia computacional, los eigenvectors del grafo Laplaciano L estánprecalculados y evidentemente sólo se calculan en tiempo real las solucionespara aquellas clases que se hayan visto alteradas por los nuevos datosintroducidos (esto es, las clases que disponen de nuevas etiquetas y tambiénaquellas clasesquehayanheredadoanotacionesalpropagarse lasetiquetasdeclasesrelacionadassemánticamente).

Una vez calculadas las nuevas soluciones, las imágenes de cada categoría sonreordenadas acordemente. A nivel ilustrativo y para aumentar la experienciainteractiva de los usuarios, se despliegan un mapa visual de las categoríasetiquetadas. El color blanco en una categoría indica 10 o más imágenesetiquetadas en la categoría, mientras que el negro implica 0 imágenesdisponiblesparaesacategoría.

Además,tambiénsemuestraunmapadeconfianzaparacadacategoría.Enella,las categorías dónde el algoritmo presenta mayor confianza aparecen másiluminadas.

Page 23: Semantic Label Sharing for Semi Supervised with large

‐23‐

Es importantedestacarcómo,apesarde laspocascategoríaspara lascuáleselsistemadisponedeimágenesetiquetadas,existeunagrancantidaddecategoríaspara lasqueelalgoritmoescapazdeclasificarcorrectamentealgunaimagen,apesardenotenerejemplosdeentrenamientodisponiblesparamuchasdeellas.Noescasualqueprecisamenteparaseaen lasseccionesdeplantasyciudadesdondeelalgoritmofuncionamejor,puestoqueenestascategoríaslasimilaridadvisualentreimágenesdeclasessemánticamentecercanasessuperior.

Finalmente, se ha incorporado un subset de control para la medición de lafiabilidad y el descarte de las etiquetas deliberadamente fraudulentas. Elporcentajede imágenes correctamente clasificadasdel set de control seutilizaparadarunaestimacióndelacantidaddelnúmerodeimágenescorrectamenteclasificadas. La gráfica siguientemuestra la evolución temporal del númerodeimágenesdelabasededatoscorrectamenteidentificadassegúnelinputhumanorecibido.

 

Page 24: Semantic Label Sharing for Semi Supervised with large

‐24‐

Conclusiones 

La utilización de un esquema de Semi‐supervised Learning nos ha permitidotrabajareficazmenteconmillonesdeimágenesydecenasdemilesdecategoríasdistintas.Enestecontexto,dondesedisponecomparativamentedemuy pocosejemplos de entrenamiento y donde no puede asegurarse la disponibilidad deimágenes representativas para todas las clases, hemos introducido unmétodopara la compartición sistemática de etiquetas de entrenamiento entre clases.NuestrosexperimentosendiferentesbasesdedatosponendemanifiestoqueelSemantic Label Sharing aporta mejoras significativas en situaciones dondeconviven muchas clases, un escenario habitual en grandes colecciones deimágenes. Se ha mostrado como el Semantic Sharing, en combinación con unesquemadeSemi‐supervisedLearning,puede llegaraoperarefectivamenteenbases de datos de hasta 75.000 clases y 79 millones de imágenes. Más aún,nuestros experimentos demuestran que nuestro esquema de comparticiónsupera otros métodos que también se utilizan información semántica para laconstruccióndelclasificador.

Gracias al éxito delmétodo, se ha puesto enmarcha una aplicaciónweb en labase de datos de Tiny Images cuyo objetivo es apalancarse en la informaciónproporcionada interactivamente por los usuarios para mejorar el proceso deaprendizaje y poder obtener mejores soluciones de clasificación para lasimágenesdelasdistintascategorías.

Comotrabajofuturo,deberíaplantearselaposibilidaddeincorporaralmodelola propagación de ejemplos negativos, puesto que nuestro Semantic LabelSharing solo transmite las etiquetas positivas. Además, la utilización de lainformación semántica presenta algunos límites al modelo que deberánabordarseenun futuro: lapolisemiademuchaspalabras,o lavisualizacióndeconceptos abstractos presentes en WordNet pero sin una imagen clara sonfactores que se han excluido del presente trabajo. En este sentido, aunque lamatriz de Semantic Sharing de WordNet ha sido útil y efectiva, un objetivoulteriorpodría ser el aprendizajede lamatrizde sharing apartirde la propiaconfiguracióndelosdatos.

 

Page 25: Semantic Label Sharing for Semi Supervised with large

‐25‐

Bibliografía 

1.Torralba,A.,Fergus,R.,Freeman,W.T.:80milliontinyimages:alargedatabasefornon‐parametricobjectandscenerecognition.IEEEPAMI30(2008)1958–1970

2.Russell,B.C.,Torralba,A.,Murphy,K.P.,Freeman,W.T.:Labelme:adatabaseandweb‐basedtoolforimageannotation.IJCV77(2008)157–173

3.OxfordEnglishDictionary(2009)

4.Deng,J.,Dong,W.,Socher,R.,Li,L.J.,Li,K.,Fei‐Fei,L.:ImageNet:ALarge‐ScaleHierarchicalImageDatabase.In:CVPR09.(2009)

5.Fellbaum,C.:WordNet:AnElectronicLexicalDatabase.BradfordBooks(1998)

6.Biederman,I.:Recognition‐by‐components:Atheoryofhumanimageunderstanding.PsychologicalReview94(1987)115–147

7.Krizhevsky,A.:Learningmultiplelayersoffeaturesfromtinyimages.Technicalreport,UniversityofToronto(2009)

8.Li,L.J.,Wang,G.,Fei‐Fei,L.:Imagenet.In:CVPR.(2007)

9.Fergus,R.,Fei‐Fei,L.,Perona,P.,Zisserman,A.:Learningobjectcategoriesfromgoogle’simagesearch.In:ICCV.Volume2.(2005)1816–1823

10.Berg,T.,Forsyth,D.:Animalsontheweb.In:CVPR.(2006)1463–1470

11.Caruana,R.:Multitasklearning.MachineLearning28(1997)41–75

12.LeCun,Y.,Bottou,L.,Bengio,Y.,Haffner,P.:Gradient‐basedlearningappliedtodocumentrecognition.Proc.IEEE86(1998)2278–2324

13.Torralba,A.,OlivaA.:Modelingtheshapeofthescene:aholisticrepresentationofthespatialenvelope.ICJV,Vol.42(3):145‐175,2001

14.Torralba,A.,Murphy,K.,Freeman,W.:Sharingfeatures:efficientboostingproceduresformulticlassobjectdetection.In:Proc.ofthe2004IEEECVPR.(2004)

15.Opelt,A.,Pinz,A.,Zisserman,A.:Incrementallearningofobjectdetectorsusingavisualshapealphabet.In:CVPR(1).(2006)3–10

16.Fei‐Fei,L.,Fergus,R.,Perona,P.:One‐shotlearningofobjectcategories.IEEE.TransactionsonPatternAnalysisandMachineIntelligence(Toappear‐2004)

17.Sudderth,E.,Torralba,A.,Freeman,W.,Willsky,A.:Learninghierarchicalmodelsofscenes,objects,andparts.In:ProceedingsoftheIEEEInternationalConferenceonComputerVision,Beijing.(2005)Toappear

18.Tenenbaum,J.B.,Freeman,W.T.:Separatingstyleandcontentwithbilinearmodels.NeuralComputation12(2000)1247–1283

Page 26: Semantic Label Sharing for Semi Supervised with large

‐26‐

19.Bart,E.,Ullman,S.:Cross‐generalization:learningnovelclassesfromasingleexamplebyfeaturereplacement.In:CVPR.(2005)

20.Miller,E.,Matsakis,N.,Viola,P.:Learningfromoneexamplethroughshareddensitiesontransforms.In:CVPR.Volume1.(2000)464–471

21.Quattoni,A.,Collins,M.,Darrell,T.:Transferlearningforimageclassificationwithsparseprototyperepresentations.In:CVPR.(2008)

22.Budanitsky,Hirst:EvaluatingWordNet‐basedmeasuresoflexicalsemanticrelatedness.ComputationalLinguistics(2006)

23.Chapelle,O.,Sch¨olkopf,B.,Zien,A.:Semi‐SupervisedLearning.MITPress(2006)

24.Schoelkopf,B.,Smola,A.:LearningwithKernelsSupportVectorMachines,Regularization,Optimization,andBeyond.MITPress,(2002)

25.Zhu,X.,Ghahramani,Z.,Lafferty,J.:Semi‐supervisedlearningusingGaussianfieldsandharmonicfunctions.In:InICML.(2003)912–919

26.Fergus,R.,Weiss,Y.,Torralba,A.:Semi‐supervisedlearningingiganticimagecollections.In:NIPS.(2009)

27.Marszalek,M.,Schmid,C.:Semantichierarchiesforvisualobjectrecognition.In:CVPR.(2007)

Page 27: Semantic Label Sharing for Semi Supervised with large

Semantic Label Sharing for Learning

with Many Categories

Rob Fergus1, Hector Bernal2, Yair Weiss3, Antonio Torralba2

1Courant Institute, 2CSAIL, 3School of Computer ScienceNew York University MIT Hebrew University

[email protected], {hectorbernal,torralba}@csail.mit.edu,[email protected]

Abstract. In an object recognition scenario with tens of thousands ofcategories, even a small number of labels per category leads to a verylarge number of total labels required. We propose a simple method oflabel sharing between semantically similar categories. We leverage theWordNet hierarchy to define semantic distance between any two cate-gories and use this semantic distance to share labels. Our approach canbe used with any classifier. Experimental results on a range of datasets,upto 80 million images and 75,000 categories in size, show that despitethe simplicity of the approach, it leads to significant improvements inperformance.

1 Introduction

Large image collections on the Internet and elsewhere contain a multitude ofscenes and objects. Recent work in computer vision has explored the problemsof visual search and recognition in this challenging environment. However, allapproaches require some amount of hand-labeled training data in order to buildeffective models. Working with large numbers of images creates two challenges:first, labeling a representative set of images and, second, developing efficientalgorithms that scale to very large databases.

Labeling Internet imagery is challenging in two respects: first, the sheer num-ber of images means that the labels will only ever cover a small fraction of images.Recent collaborative labeling efforts such as Peekaboom, LabelMe, ImageNet [2–4] have gathered millions of labels at the image and object level. However thisis but a tiny fraction of the estimated 10 billion images on Facebook, let alonethe hundreds of petabytes of video on YouTube. Second, the diversity of thedata means that many thousands of classes will be needed to give an accuratedescription of the visual content. Current recognition datasets use 10’s to 100’sof classes which give a hopelessly coarse quantization of images into discretecategories. The richness of our visual world is reflected by the enormous numberof nouns present in our language: English has around 70,000 that correspondto actual objects [5]. This figure loosely agrees with the 30,000 visual conceptsestimated by psychologists [6]. Furthermore, having a huge number of classes di-lutes the available labels, meaning that, on average, there will be relatively few

Page 28: Semantic Label Sharing for Semi Supervised with large

2 Rob Fergus1, Hector Bernal2, Yair Weiss3, Antonio Torralba2

“Turb

op

rop

” se

arch

en

gin

e re

sult

Re

-ran

ked

ima

ge

s “

Po

ny

” s

ea

rch

en

gin

e r

esu

ltR

e-r

an

ked

ima

ge

s

Fig. 1. Two examples of images from the Tiny Images database [1] being re-ranked byour approach, according to the probability of belonging to the categories “pony” and“turboprop” respectively. No training labels were available for either class. However64,185 images from the total of 80 million were labeled, spread over 386 classes, someof which are semantically close to the two categories. Using these labels in our semanticlabel sharing scheme, we can dramatically improve search quality.

annotated examples per class (and many classes might not have any annotateddata).

To illustrate the challenge of obtaining high quality labels in the scenario ofmany categories, consider the CIFAR-10 dataset constructed by Alex Krizhevskyand Geoff Hinton [7]. This dataset provides human labels for a subset of theTiny Images [1] dataset which was obtained by querying Internet search engineswith over 70,000 search terms. To construct the labels, Krizhevsky and Hintonchose 10 classes “airplane”, “automobile”, “bird”, “cat”, “deer”, “dog”, “frog”,“horse”, “ship”, “truck”, and for each class they used the WordNet hierarchy toconstruct a set of hyponyms. The labelers were asked to examine all the imageswhich were found with a search term that is a hyponym of the class. As anexample, some of the hyponyms of ship are “cargo ship”, “ocean liner”, and“frigate”. The labelers were instructed to reject images which did not belongto their assigned class. Using this procedure, labels on a total of 386 categories(hyponyms of the 10 classes listed above) were collected at a cost of thousandsof dollars.

Despite the high cost of obtaining these labels, the 386 categories are ofcourse a tiny subset of the possible labels in the English language. Considerfor example the words “pony” and “turboprop” (Fig. 1). Neither of these isconsidered a hyponym of the 10 classes mentioned above. Yet there is obviousinformation in the labeled data for “horse” and “airplane” that we would like touse to improve the search engine results of “pony” and “turboprop”.

In this paper, we provide a very simple method for sharing labels betweencategories. Our approach is based on a basic assumption – we expect the clas-

Page 29: Semantic Label Sharing for Semi Supervised with large

Semantic Label Sharing for Learning with Many Categories 3

sifier output for a single category to degrade gracefully with semantic distance.In other words, although horses are not exactly ponies, we expect a classifierfor “pony” to give higher values for “horses” than to “airplanes”. Our scheme,which we call “Semantic Label Sharing” gives the performance shown in Fig. 1.Even though we have no labels for “pony” and “turboprop” specifically, we cansignificantly improve the performance of search engines by using label sharing.

1.1 Related Work

Various recognition approaches have been applied to Internet data, with the aimof re-ranking, or refining the output of image search engines. These include: Liet al. [8], Fergus et al. [9], Berg et al. [10], amongst others. Our approach differsin two respects: (i) these approaches treat each class independently; (ii) they arenot designed to scale to the billions of images on the web.

Sharing information across classes is a widely explored concept in vision andlearning, and takes many different forms. Some of the first approaches appliedto object recognition are based on neural networks in which sharing is achievedvia the hidden layers which are common across all tasks [11, 12]. Error correct-ing output codes[13] also look at a way of combining multi-class classifiers toobtain better performance. Another set of approaches tries to transfer informa-tion from one class to another by regularizing the parameters of the classifiersacross classes. Torralba et al. , Opelt et al. [14, 15] demonstrated its power insharing useful features between classes within a boosting framework. Other ap-proaches transfer information across object categories by sharing a common setof parts [16, 17], by sharing transformations across different instances [18–20],or by sharing a set of prototypes [21]. Common to all those approaches is thatthe experiments are always performed with relatively few classes. Furthermore,it is not clear how these techniques would scale to very large databases withthousands of classes.

Our sharing takes a different form to these approaches, in that we imposesharing on the class labels themselves, rather than in the features or parametersof the model. As such, our approach has the advantage that it it is independentof the choice of the classifier.

2 Semantic Label Sharing

Following [22] we define the semantic distance between two classes using a treedefined by WordNet1. We use a simple metric that measures the intersection be-tween the ancestors of two words: the semantic distance Sij between classes i andj (which are nodes in the tree) is defined as the number of nodes shared by theirtwo parent branches, divided by the length of the longest of the two branches,i.e. Sij = intersect(par(i), par(j))/max(length(par(i)), length(par(j))), where

1 Wordnet is graph-structured and we convert it into a tree by taking the most commonsense of a word.

Page 30: Semantic Label Sharing for Semi Supervised with large

4 Rob Fergus1, Hector Bernal2, Yair Weiss3, Antonio Torralba2

par(i) is the path from the root node to node i. For instance, the semantic sim-ilarity between a “felis domesticus” and “tabby cat” is 0.93, while the distancebetween “felis domesticus” and a “tractor trailer” is 0.21. We construct a sparsesemantic affinity matrix A = exp(−κ(1 − S)), with κ = 10 for all the exper-iments in this paper. For the class “airbus”, the nearest semantic classes are:“airliner” (0.49), “monoplane” (0.24), “dive bomber” (0.24), “twinjet” (0.24),“jumbo jet” (0.24), and “boat” (0.03). A visualization of A and a closeup areshown in Fig. 3(a) and (b).

Let us assume we have a total of C classes, hence A will be a C×C symmetricmatrix. We are given L labeled examples in total, distributed over these Cclasses. The labels for class c are represented by a binary vector yc of length Lwhich has values 1 for positive hand-labeled examples and 0 otherwise. Hencepositive examples for class c are regarded as negative labels for all other classes.Y = {y1, . . . , yC} is an N × C matrix holding the label vectors from all classes.

We share labels between classes by replacing Y with Y A. This simple oper-ation has a number of effects:

– Positive examples are copied between classes, weighted according to theirsemantic affinity. For example, the label vector for “felis domesticus” previ-ously had zero values for the images of “tabby cat”, but now these elementsare replaced by the value 0.93.

– However, labels from unrelated classes will only deviate slightly from theiroriginal state of 0 (dependent on the value of κ).

– Negative labeled examples from classes outside the set of C are unaffectedby A (since they are 0 across all rows of Y ).

– Even if each class has only a few labeled examples, the multiplication by Awill effectively pool examples across semantically similar classes, dramati-cally increasing the number that can be used for training, provided seman-tically similar classes are present amongst the set of C.

The effect of this operation is illustrated in two examples on toy data, shownin Fig. 2. These examples show good classifiers can be trained by sharing labelsbetween classes, given knowledge of the inter-class affinities, even when no labelsare given for the target class. In Fig. 2, there are 9 classes but label data is onlygiven for 7 classes. In addition to the labels, the system also has access to theaffinities among the 9 classes. This information is enough to build classificationfunctions for the classes with no labels (Fig. 2(d) and (f)).

From another perspective, our sharing mechanism turns the original classifi-cation problem into a regression problem: the formerly binary labels in Y becomereal-values in Y A. As such we can adapt many types of classifiers to minimizeregression error rather than classification error.

3 Sharing in Semi-Supervised Learning

Semi-supervised learning is an attractive option in settings where very few train-ing examples exist since the density of the data can be used to regularize the

Page 31: Semantic Label Sharing for Semi Supervised with large

Semantic Label Sharing for Learning with Many Categories 5

f function

(d) 0

0.25

0.5

0.75

1

Data

(a)

Weighted training points

(c)Labeled examples

(b)

1 2

4 6

7 8 9

3

0

0.25

0.5

0.75

1

(f )

f function5

(e)

Weighted training points

Fig. 2. Toy data illustrating our sharing mechanism between 9 different classes (a) indiscrete clusters. For 7 of the 9 classes, a few examples are labeled (b). No labels existfor the classes 3 and 5. (c): Labels re-weighted by affinity to class 3. (Red=high affinity,Blue=low affinity). (d): This plot shows the semi-supervised learning solution fclass=3

using weighted labels from (c). The value of the function fclass=3 on each sample from(a) is color coded. Dark red corresponds to the samples more likely to belong to class 3.(e): Labels re-weighted by affinity to class 5. (d): Solution of semi-supervised learningsolution fclass=5 using weighted labels from (e).

entity

physical entity

physical object animate thing

being

fauna

chordate

craniate

mammalian

eutherian mammal

carnivore

canid

Canis familiaris

felid

true cat

Felis catus toy

Japanese spaniel

hoofed mammal

artiodactyl mammal

ruminant

cervid

unit

artefact

instrumentation

transport

vehicle

craft aircraft heavier

air craft

plane

airliner

airbus

watercraft

boat

attack aircraft

tabby cat

wheeled vehicle

self propelled vehicle

automobile

Alces

automotive vehicle

Peke

perissodactyl mammal

equid

Equus caballus

mount

quarter horse

bomber

bird

Maltese

flightless bird

Emu

stud mare

compact car

amphibian

salientian

ranid

mutt

true toad

fighter aircraft

fire truck

motortruck

aerial ladder truck

mouser

ship

cargo vessel

dump truck powerboat

speedboat

Appaloosa

toy spaniel

King

Charles spaniel

passeriform bird

bird

Prunella

modularis

jet propelled

plane

twinjet

English

toy spaniel

Blenheim spaniel

coupe

ostrich

jumbo

jet

merchant

ship

moving van

car

jetliner

container vessel

wagtail

offspring

young mammal

puppy

wagon

station wagon

motorcar

shooting brake

passenger ship

patrol car

tomcat

horse

stealth fighter

estate car

true sparrow

camion

Capreolus

truck

delivery truck

tipper truck

garbage truck

stallion

motorcar

lorry

police cruiser

tractor trailer

20 40 60 80 100 120

20

40

60

80

100

120 0

0. 1

0. 2

0. 3

0. 4

0. 5

0. 6

0. 7

0. 8

0. 9

1

true cat

gelding

motorcar

camion

cargo ship

lippizaner

patrol car

stealthbomber

jetliner

0

0. 1

0. 2

0. 3

0. 4

0. 5

0. 6

0. 7

0. 8

0. 9

true

ca

t

ge

ldin

g

mo

torc

ar

ca

mio

n

ca

rgo

sh

ip

lipp

iza

ne

r

pa

trol c

ar

ste

alth

bo

mb

er

jetlin

er

1

a) b)

c)

van

va

n

Fig. 3. Wordnet sub-tree for a subset of 386 classes used in our experiments. Theassociated semantic affinity matrix A is shown in (a), along with a closeup of 10randomly chosen rows and columns in (b).

solution. This can help prevent over-fitting the few training examples and yieldsuperior solutions. A popular class of semi-supervised algorithms are based onthe graph Laplacian and we use an approach of this type.

We briefly describe semi-supervised learning in a graph setting. In additionto the L labeled examples (Xl, Yl) = {(x1, y1), ..., (xL, yL)} introduced above,we have an additional U unlabeled images Xu = {xL+1, ..., xN}, for a totalof N images. We form a graph where the vertices are the images X and theedges are represented by an N × N matrix W . The edge weighting is givenby Wij = exp(−‖xi − xj‖

2/2ǫ2), the visual affinity between images i and j.Defining D = diag(

∑j Wij), we define the normalized graph Laplacian to be:

L = I = D−1/2WD−1/2. We use L to measure the smoothness of solutions over

Page 32: Semantic Label Sharing for Semi Supervised with large

6 Rob Fergus1, Hector Bernal2, Yair Weiss3, Antonio Torralba2

the data points, desiring solutions that agree with the labels but are also smoothwith respect to the graph. In the single class case we want to minimize:

J(f) = fT Lf +

l∑

i=1

λ(fi − yi)2 = fT Lf + (f − y)T Λ(f − y) (1)

where Λ is a diagonal matrix whose diagonal elements are Λii = λ if i is alabeled point and Λii = 0 for unlabeled points. The solution is given by solvingthe N × N linear system (L + Λ)f = Λy.

This system is impractical to solve for large N , thus it is common [23–25]to reduce the dimension of the problem by using the smallest k eigenvectorsof L (which will be the smoothest) U as a basis with coefficients α: f = Uα.Substituting into Eqn. 1, we find the optimal coefficients α to be the solution ofthe following k × k system:

(Σ + UT ΛU)α = UT Λy (2)

where Σ is a diagonal matrix of the smallest k eigenvectors of L. While thissystem is easy to solve, the difficulty is computing the eigenvectors an O(N2)operation.

Fergus et al. [26] introduced an efficient scheme for computing approximateeigenvectors in O(N) time. This approach proceeds by first computing numericalapproximations to the eigenfunctions (the limit of the eigenvectors as N → ∞).Then approximations to the eigenvectors are computed via a series of 1D interpo-lations into the numerical eigenfunctions. The resulting approximate eigenvectors(and associated eigenvalues) can be used in place of U and Σ in Eqn. 2.

Extending the above formulations to the multi-class scenario is straightfor-ward. In a multi-class problem, the labels will be held in an N ×C binary matrixY , replacing y in Eqn. 2. We then solve for the N × C matrix F using the ap-proach of Fergus et al. Utilizing the semantic sharing from Section 2 is simple,with Y being replaced with Y A.

4 Experiments

We evaluate our sharing framework on two tasks: (a) improving the performanceof images returned by Internet search engines; (b) object classification. Notethat the first problem consists of a set of 2-class problems (e.g. sort the ponyimages from the non-pony images), while the second problem is a multi-classclassification with many classes.

These tasks are performed on three datasets linked to the Tiny Imagesdatabase [1], a diverse and highly variable image collection downloaded fromthe Internet:

– CIFAR: This consists of 63,000 images from 126 classes selected2 from theCIFAR-10 dataset [7], which is a hand-labeled sub-set of the Tiny Images.

2 The selected classes were those that had at least 200 positive labels and 300 negativelabels, to enable accurate evaluation.

Page 33: Semantic Label Sharing for Semi Supervised with large

Semantic Label Sharing for Learning with Many Categories 7

These keywords and their semantic relationship to one another are shown inFig. 3. For each keyword, we randomly choose a fixed test-set of 75 positiveand 150 negative examples, reflecting the typical signal-to-noise ratio foundin images from Internet search engines. From the remaining images for eachclass, we randomly draw a validation set of 25/50 +ve/-ve examples. Thetraining examples consist of +ve/-ve pairs drawn from the remaining poolof 100 positive/negative images for each keyword.

– Tiny: The whole Tiny Images dataset, consisting of 79,302,017 images dis-tributed over 74,569 classes (keywords used to download the images fromthe Internet). No human-provided labels are available for this dataset, thusinstead we use the noisy labels from the image search engines. For each classwe assume the first 5 images to be true positive examples. Thus over thedataset, we have a total of 372,845 (noisy) positive training examples, andthe same number of negative examples (drawn at random). For evaluation,we can use labeled examples from either the CIFAR or High-res datasets.

– High-res: This is a sub-set of 10,957,654 images from the Tiny Images, forwhich the high-resolution original image exists. These images span 53,564different classes, distributed evenly over all classes within the Tiny Imagesdataset. As with the Tiny dataset, we use no hand-labeled examples fortraining, instead using the first 5 examples for each class as positive exam-ples (and 5 negative drawn randomly). For evaluation, we use 5,357 human-labeled images split into 2,569 and 2,788 positive and negative examples ofeach class respectively.

Pre-processing: For all datasets, each image is represented by a single Gistdescriptor. In the case of the Tiny and CIFAR datasets, a 384-D descriptor isused which is then mapped down to 32 and 64 dimensions using PCA, for Tiny

and CIFAR respectively. For the High-res dataset, a 512-D Gist descriptor ismapped down to 48-D using PCA.

4.1 Re-ranking experiments

On the re-ranking task we first use the CIFAR dataset to quantify the effects ofsemantic sharing. For each class separately we train a classifier on the trainingset (possibly using sharing) and use it to re-rank the 250 test images, measuringthe precision at 15% recall. Unless otherwise stated, the classifier used is thesemi-supervised approach of Fergus et al. [26].

In Fig. 4(left) we explore the effects of semantic sharing, averaging perfor-mance over all 126 classes. The validation set is used to automatically selectthe optimal values of κ and λ. The application of the Wordnet semantic affinitymatrix can be seen to help performance. If the semantic matrix is randomlypermuted (but with the diagonal fixed to be 1), then this is somewhat worsethan not using sharing. But if the sharing is inverted (by replacing A with 1−Aand setting the diagonal to 1), it clearly hinders performance. The same patternof results can be see in Fig. 4(right) for a nearest neighbor classifier. Hence the

Page 34: Semantic Label Sharing for Semi Supervised with large

8 Rob Fergus1, Hector Bernal2, Yair Weiss3, Antonio Torralba2

−Inf 0 1 2 3 4 5 6 7 0.3

0.35

0.4

0.45

0.5

0.55

0.6

0.65

0.7

0.75

Log2 number of training pairs

Mea

n pr

ecis

ion

at 1

5% r

ecal

l a

vera

ged

over

126

cla

sses

Semi−supervised Learning

Wordnet

None

Random

Inverse

−Inf 0 1 2 3 4 5 6 7 0.3

0.35

0.4

0.45

0.5

0.55

0.6

0.65

0.7

0.75

Log2 number of training pairs

Mea

n pr

ecis

ion

at 1

5% r

ecal

l a

vera

ged

over

126

cla

sses

Nearest Neighbors

Wordnet

None

Random

Inverse

Fig. 4. Left: Performance for different sharing strategies with the semi-supervised learn-ing approach of [26] as the number of training examples is increased, using 126 classesin the CIFAR dataset. Right: As for (left) but with a nearest neighbor classifier. Theblack dashed line indicates chance level performance. When the Wordnet matrix isused for sharing it gives a clear performance improvement (red) to both methods overno sharing [26] (green). However, if the semantic matrix does not reflect the similaritybetween classes, then it hinders performance (e.g. random (blue) and inverse (magenta)curves).

semantic matrix must reflect the relationship between classes if it is to be ef-fective. In Fig. 5 we show examples of the re-ranking, using the semi-supervisedlearning scheme in conjunction with the Wordnet affinity matrix.

In Fig. 6(left & middle), we perform a more systematic exploration of theeffects of Wordnet sharing. For these experiments we use fixed values of κ = 5and λ = 1000. Both the number of classes and number of images are varied, andthe performance recorded with and without the semantic affinity matrix. Thesharing gives a significant performance boost, particularly when few trainingexamples are available.

The sharing behavior can be used to effectively learn classes for which wehave zero training examples. In Fig. 7, we explore what happens when we allocate0 training images to one particular class (the left-out class) from the set of 126,while using 100 training pairs for the remaining 125 classes. When the sharingmatrix is not used, the performance of the left-out class drops significantly,relative to its performance when training data is available (i.e. the point foreach left-out class falls below the diagonal). But when sharing is used, the dropin performance is relatively small, with points being spread around the diagonal.

Motivated by Fig. 7, we show in Fig. 1 the approach applied to the Tiny

dataset, using the human-provided labels from the CIFAR dataset. However, noCIFAR labels exist for the two classes selected (Pony, Turboprop). Instead, weused the Wordnet matrix to share labels from semantically similar classes forwhich labels do exist. The qualitatively good results demonstrated in Fig. 1 canonly be obtained relatively close to the 126 keywords for which we have labels.

Page 35: Semantic Label Sharing for Semi Supervised with large

Semantic Label Sharing for Learning with Many Categories 9

Airbus

Japanese

Spaniel Ostrich Deer Fire truck Appaloosa

Honey

Eater

Init

ial o

rde

rO

utp

ut

ord

er

Fig. 5. Test images from 7 keywords drawn from the 126 class CIFAR dataset. Theborder of each image indicates its label (used for evaluation purposes only) with respectto the keyword, green = +ve, red = -ve. The top row shows the initial ranking of thedata, while the bottom row shows the re-ranking of our approach trained on 126 classeswith 100 training pairs/classes.

Log2 # classes

# tr

aini

ng p

airs

2 3 4 5 6 7

1

2

3

5

8

10

15

20

40

60

1000.35

0.4

0.45

0.5

0.55

0.6

0.65

0.7

0.75

Log2 # classes

2 3 4 5 6 7

1

2

3

5

8

10

15

20

40

60

1000.35

0.4

0.45

0.5

0.55

0.6

0.65

0.7

0.75

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10.4

0.5

0.6

0.7

0.8

0.9

1

Recall

Pre

cisi

on

No Sharing

Semantic Sharing

Fig. 6. Left & Middle: The variation in precision for the semi-supervised approach asthe number of training examples is increased, using 126 classes with (left) and without(middle) Wordnet sharing. Note the improvement in performance for small numbers oftraining examples when the Wordnet sharing matrix is used. Right: Evaluation of oursharing scheme for the re-ranking task on the 10 million image High-res dataset, using5,357 test examples. Our classifier was trained using 0 hand-labeled examples and 5noisy labels per class. Using a Wordnet semantic affinity matrix over the 53,564 classesgives a clear boost to performance.

Page 36: Semantic Label Sharing for Semi Supervised with large

10 Rob Fergus1, Hector Bernal2, Yair Weiss3, Antonio Torralba2

0.2 0.4 0.6 0.8 10.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1Using semantic sharing

Performance using 100 training pairs

Pe

rfo

rma

nce

usi

ng

0 t

rain

ing

pa

irs

(an

d a

ll o

the

r cl

ass

es

ha

ve

10

0 t

rain

ing

pa

irs)

0.2 0.4 0.6 0.8 10.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1No semantic sharing

Performance using 100 training pairs

Pe

rfo

rma

nce

usi

ng

0 t

rain

ing

pa

irs

(an

d a

ll o

the

r cl

ass

es

ha

ve

10

0 t

rain

ing

pa

irs)

Fig. 7. An exploration of the performance with 0 training examples for a single class,if all the other classes have 100 training pairs. Left: By using the sharing matrix A, wecan obtain a good performance by transferring labels from semantically similar classes.Right: Without it, the performance drops significantly.

This performance gain obtained by Wordnet sharing is quantified in a large-scale setting in Fig. 6(right) using the High-res dataset. Chance level perfor-mance corresponds to 2569/(2569+2788) = 48%. Without any sharing, the semi-supervised scheme (blue) gives a modest performance. But when the Wordnetsharing is added, there is significant performance boost.

Our final re-ranking experiment applies the semantic sharing scheme to thewhole of the Tiny dataset (with no CIFAR labels used). With 74,569 classes,many will be very similar visually and our sharing scheme can be expected togreatly assist performance. In Fig. 11 we show qualitative results for 4 classes.The semi-supervised algorithm takes around 0.1 seconds to perform each re-ranking (since the eigenfunctions are precomputed), compared to over 1 minutefor the nearest-neighbor classifier. These figures show qualitatively that the semi-supervised learning scheme with semantic sharing clearly improves search per-formance over the original ranking and that without the sharing matrix theperformance drops significantly.

4.2 Classification experiments

Classification with many classes is extremely challenging. For example, pickingthe correct class out of 75,000 is something that even humans typically cannotdo. Hence instead of using standard metrics, we measure how far the predictedclass is from the true class, as given by the semantic distance matrix S. Underthis measure the true class has distance 0, while 1 indicates total dissimilarity.Fig. 8 illustrates this metric with two example images and a set of samplesvarying in distance from them.

We compare our semantic sharing approach in the semi-supervised learningframework of [26] to two other approaches: (i) linear 1-vs-all SVM; (ii) the hier-archical SVM approach of Marszalek and Schmid [27]. The latter method usesthe semantic relationships between classes to construct a hierarchy of SVMs. In

Page 37: Semantic Label Sharing for Semi Supervised with large

Semantic Label Sharing for Learning with Many Categories 11

AphroditeTolkienChocolateice creamJetLocomotiveUmbrellaTricornRaincoat

Longpants Miniskirt

0.700.40

Semantic distance to “Long pants”

0.300 0.20 0.620.50 0.910.800.11

Rosadamascena Jasmine Fig−bird

Blackraspberry Napoleon Croissant

Swisspine

Commonbean

FireAlarm

Chinarose

0.1 0.18

Semantic distance to “China rose”

0.47 0.910.820.620.33 0.640 0.38

Fig. 8. Our semantic distance performance metric for two examples “Long pants” and“China rose”. The other images are labeled with their semantic distance to the twoexamples. Distances under 0.2 correspond to visual similar objects.

implementing this approach, we use the same Wordnet tree structure from whichthe semantic distance matrix S is derived. At each edge in the tree, we train alinear SVM in the manner described in [27]. Note that both our semantic sharingmethod and that of Marszalek and Schmid are provided with the same semanticinformation. Hence, by comparing the two approaches we can see which makesmore efficient use of the semantic information.

These three approaches are evaluated on the CIFAR and High-res datasets inFigures 9 and 10 respectively. The latter dataset also shows the semi-supervisedscheme without sharing. The two figures show consistent results that clearlydemonstrate: (i) the addition of semantic information helps – both the H-SVMand SSL with sharing beat the methods without it; (ii) our sharing frameworkis superior to that of Marszalek and Schmid [27].

5 Summary and future work

We have introduced a very simple mechanism for sharing training labels betweenclasses. Our experiments on a variety of datasets demonstrate that it gives signif-icant benefits in situations where there are many classes, a common occurrencein large image collections. We have shown how semantic sharing can be com-bined with simple classifiers to operate on large datasets up to 75,000 classesand 79 million images. Furthermore, our experiments clearly demonstrate thatour sharing approach outperforms other methods that use semantic informationwhen constructing the classifier. While the semantic sharing matrix from Word-net has proven effective, a goal of future work would be to learn it directly fromthe data.

Page 38: Semantic Label Sharing for Semi Supervised with large

12 Rob Fergus1, Hector Bernal2, Yair Weiss3, Antonio Torralba2

0 1 2 3 4 5 6 70.25

0.3

0.35

0.4

0.45

Log2 number of training pairs per class

Mea

n se

man

tic d

ista

nce

from

true

cla

ss

SVMH−SVMSharing SSL

0 0.2 0.4 0.6 0.8 10

0.5

1

1.5

2

2.5

3

3.5

4

Semantic distance from true class

Pro

babi

lity

dens

ity

SVMH−SVMSharing SSLChance

Fig. 9. Comparison of approaches for classification on the CIFAR dataset. Red: 1 vs alllinear SVM; Green: Hierarchical SVM approach of Marszalek and Schmid [27]; Blue:Our semantic sharing scheme in the semi-supervised approach of [26]; Black: Chance.Left: Mean semantic distance of test examples to true class as the number of labeledtraining examples increases (smaller is better). Right: For 100 training examples perclass, the distribution of distances for the positive test examples. Our sharing approachhas a significantly lower mean semantic distance, with a large mass at a distance < 0.2,corresponding to superior classification performance. See Fig. 8 for an illustration ofsemantic distance.

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.5

1

1.5

2

2.5

3

3.5

Semantic distance from true class

Pro

ba

bili

ty d

en

sity

Random choice

SVM

H−SVM

Sharing SSL

Non sharing SSL

Random Chance SVM SSL H-SVM Sharing SSL0.5

0.55

0.6

0.65

0.7

0.75

0.8Average semantic distance from true class

Fig. 10. Comparison of approaches for classification on the High-res dataset. Red: 1vs all linear SVM; Green: Hierarchical SVM approach of Marszalek and Schmid [27];Magenta: the semi-supervised scheme of [26]; Blue: [26] with our semantic sharingscheme; Black: Random chance. Left: Bar chart showing mean semantic distance fromtrue label on test set. Right: The distribution of distances for each method on the testset. Our approach has more mass at a distance < 0.2, indicating superior performance.

Page 39: Semantic Label Sharing for Semi Supervised with large

Semantic Label Sharing for Learning with Many Categories 13

Raw Images SSL, no sharing SSL, Wordnet sharing NN, Wordnet sharing

Po

ny

Ra

bb

ite

ye B

lue

be

rry

Na

po

leo

nP

on

d L

ily

Fig. 11. Sample results of our semantic label sharing scheme on the Tiny dataset (79million images). 0 hand-labeled training examples were used. Instead, the first 5 im-ages of each of the 74,569 classes were taken as positive examples. Using these labels,classifiers were trained for 4 different query classes: “pony”, “rabbiteye blueberry”,“Napoleon” and “pond lily”. Column 1: the raw image ranking from the Internetsearch engine. Column 2: re-ranking using the semi-supervised scheme without seman-tic sharing. Column 3: re-ranking with semi-supervised scheme and semantic sharing.Column 4: re-ranking with a nearest-neighbor classifier and semantic sharing. Withoutsemantic sharing, the classifier only has 5 positive training examples, thus performspoorly. But with semantic sharing it can leverage the semantically close examples fromthe pool of 5*74,569=372,845 positive examples.

Page 40: Semantic Label Sharing for Semi Supervised with large

14 Rob Fergus1, Hector Bernal2, Yair Weiss3, Antonio Torralba2

References

1. Torralba, A., Fergus, R., Freeman, W.T.: 80 million tiny images: a large databasefor non-parametric object and scene recognition. IEEE PAMI 30 (2008) 1958–1970

2. Russell, B.C., Torralba, A., Murphy, K.P., Freeman, W.T.: Labelme: a databaseand web-based tool for image annotation. IJCV 77 (2008) 157–173

3. van Ahn, L.: The ESP game (2006)4. Deng, J., Dong, W., Socher, R., Li, L.J., Li, K., Fei-Fei, L.: ImageNet: A Large-

Scale Hierarchical Image Database. In: CVPR09. (2009)5. Fellbaum, C.: Wordnet: An Electronic Lexical Database. Bradford Books (1998)6. Biederman, I.: Recognition-by-components: A theory of human image understand-

ing. Psychological Review 94 (1987) 115–1477. Krizhevsky, A.: Learning multiple layers of features from tiny images. Technical

report, University of Toronto (2009)8. Li, L.J., Wang, G., Fei-Fei, L.: Imagenet. In: CVPR. (2007)9. Fergus, R., Fei-Fei, L., Perona, P., Zisserman, A.: Learning object categories from

google’s image search. In: ICCV. Volume 2. (2005) 1816–182310. Berg, T., Forsyth, D.: Animals on the web. In: CVPR. (2006) 1463–147011. Caruana, R.: Multitask learning. Machine Learning 28 (1997) 41–7512. LeCun, Y., Bottou, L., Bengio, Y., Haffner, P.: Gradient-based learning applied to

document recognition. Proc. IEEE 86 (1998) 2278–232413. Dietterich, T.G., Bakiri, G.: Solving multiclass learning problems via ECOCs.

JAIR 2 (1995) 263–28614. Torralba, A., Murphy, K., Freeman, W.: Sharing features: efficient boosting pro-

cedures for multiclass object detection. In: Proc. of the 2004 IEEE CVPR. (2004)15. Opelt, A., Pinz, A., Zisserman, A.: Incremental learning of object detectors using

a visual shape alphabet. In: CVPR (1). (2006) 3–1016. Fei-Fei, L., Fergus, R., Perona, P.: One-shot learning of object categories. IEEE

Transactions on Pattern Analysis and Machine Intelligence (To appear - 2004)17. Sudderth, E., Torralba, A., Freeman, W., Willsky, A.: Learning hierarchical models

of scenes, objects, and parts. In: Proceedings of the IEEE International Conferenceon Computer Vision, Beijing. (2005) To appear

18. Tenenbaum, J.B., Freeman, W.T.: Separating style and content with bilinear mod-els. Neural Computation 12 (2000) 1247–1283

19. Bart, E., Ullman, S.: Cross-generalization: learning novel classes from a singleexample by feature replacement. In: CVPR. (2005)

20. Miller, E., Matsakis, N., Viola, P.: Learning from one example through shareddensities on transforms. In: CVPR. Volume 1. (2000) 464–471

21. Quattoni, A., Collins, M., Darrell, T.: Transfer learning for image classificationwith sparse prototype representations. In: CVPR. (2008)

22. Budanitsky, Hirst: Evaluating wordnet-based measures of lexical semantic relat-edness. Computational Linguistics (2006)

23. Chapelle, O., Scholkopf, B., Zien, A.: Semi-Supervised Learning. MIT Press (2006)24. Schoelkopf, B., Smola, A.: Learning with Kernels Support Vector Machines, Reg-

ularization, Optimization, and Beyond. MIT Press, (2002)25. Zhu, X., Ghahramani, Z., Lafferty, J.: Semi-supervised learning using gaussian

fields and harmonic functions. In: In ICML. (2003) 912–91926. Fergus, R., Weiss, Y., Torralba, A.: Semi-supervised learning in gigantic image

collections. In: NIPS. (2009)27. Marszalek, M., Schmid, C.: Semantic hierarchies for visual object recognition. In:

CVPR. (2007)