Cov txheej txheem:
- Khoom siv
- Kauj Ruam 1: Daim duab Circuit Court
- Kauj Ruam 2: Tsim Dataset rau Kev Tshawb Xyuas Tshuab Khov
- Kauj ruam 3: Txuas rau Xov Tooj Ntawm Tes
- Kauj ruam 4:
- Kauj Ruam 5: Kev cob qhia Tus Qauv thiab Hloov Kho Txoj Cai
- Kauj Ruam 6:
- Kauj ruam 7: Code
Video: Hnab Ntim Hnab Ntes Ntes Ntes: 7 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:24
COVID19 yog keeb kwm kis thoob ntiaj teb cuam tshuam rau lub ntiaj teb no phem heev thiab tib neeg tab tom tsim ntau yam cuab yeej tshiab los tawm tsam nrog nws. Peb kuj tseem tau tsim lub tshuab siv tshuaj tua kab mob tsis siv neeg thiab rab phom Thermal rau Kev Ntsuam Xyuas Qhov Tsis Kub. Hnub no peb yuav tsim ib lub cuab yeej ntxiv los pab tiv thaiv tus kabmob coronavirus. Nws yog lub tshuab ntsuas hnoos, uas tuaj yeem paub qhov txawv ntawm lub suab nrov thiab lub suab hnoos thiab tuaj yeem pab nrhiav tus neeg tsis txaus ntseeg Corona. Nws yuav siv cov txheej txheem kev kawm tshuab rau qhov ntawd.
Hauv qhov kev qhia no, peb tab tom tsim kom muaj Kev Tiv Thaiv Kev hnoos siv Arduino 33 BLE Sense thiab Edge Impulse Studio. Nws tuaj yeem sib txawv nruab nrab ntawm lub suab nrov tom qab thiab hnoos hauv lub sijhawm tiag tiag. Peb siv Edge Impulse Studio los qhia cov ntaub ntawv ntawm kev hnoos thiab ua suab nrov yav dhau los thiab tsim cov qauv TInyML zoo heev, uas tuaj yeem txheeb xyuas lub suab hnoos hauv lub sijhawm.
Khoom siv
Kho vajtse
- Arduino 33 BLE Sense
- LEDJumper
- Hlau
Software
- Ntug Impulse Studio
- Arduino IDE Cov
Kauj Ruam 1: Daim duab Circuit Court
Daim Duab Kab Duab rau Kev Tshawb Pom Kev hnoos Siv Arduino 33 BLE Sense tau hais los saud. Fritzing ib feem rau Arduino 33 BLE tsis muaj, yog li kuv siv Arduino Nano raws li ob leeg muaj tib tus pin-tawm.
Qhov ua tau zoo ntawm LED txuas nrog tus lej digital 4 ntawm Arduino 33 BLE kev nkag siab thiab cov lus tsis zoo txuas nrog GND tus pin ntawm Arduino.
Kauj Ruam 2: Tsim Dataset rau Kev Tshawb Xyuas Tshuab Khov
Raws li tau hais ua ntej, peb tab tom siv Edge Impulse Studio los qhia peb cov qauv hnoos hnoos. Txog qhov ntawd, peb yuav tsum sau cov ntaub ntawv uas muaj cov piv txwv ntawm cov ntaub ntawv uas peb xav kom tuaj yeem lees paub ntawm peb Arduino. Txij li lub hom phiaj yog txhawm rau txhawm rau hnoos, koj yuav tsum sau qee qhov piv txwv ntawm qhov ntawd thiab qee qhov piv txwv rau lub suab nrov, yog li nws tuaj yeem paub qhov txawv ntawm hnoos thiab lwm yam nrov nrov. Peb yuav tsim cov ntaub ntawv nrog ob chav kawm "hnoos" thiab "nrov nrov". Txhawm rau tsim cov ntaub ntawv, tsim ib qho Edge Impulse account, txheeb xyuas koj tus lej nyiaj thiab tom qab ntawd pib qhov haujlwm tshiab. Koj tuaj yeem thauj cov qauv los ntawm kev siv koj lub xov tooj ntawm tes, koj pawg thawj coj Arduino lossis koj tuaj yeem xa cov ntaub ntawv mus rau hauv koj li nyiaj txiag tsis txaus ntseeg. Txoj hauv kev yooj yim tshaj plaws los kuaj cov qauv rau hauv koj tus as khauj yog siv koj lub xov tooj ntawm tes. Txog qhov ntawd, koj yuav tsum txuas koj lub xov tooj nrog Edge Impulse. Txhawm rau txuas koj lub xov tooj ntawm tes, nyem rau ntawm 'Devices' thiab tom qab ntawd nyem rau 'Txuas Tus Ntaus Tshiab'.
Kauj ruam 3: Txuas rau Xov Tooj Ntawm Tes
Tam sim no hauv lub qhov rai tom ntej, nyem rau ntawm 'Siv Koj Lub Xov Tooj', thiab QR code yuav tshwm sim. Luam theej duab QR chaws nrog koj Lub Xov Tooj Siv Google Lens lossis lwm yam QR code scanner app.
Qhov no yuav txuas koj lub xov tooj nrog Edge Impulse studio.
Nrog koj lub xov tooj txuas nrog Edge Impulse Studio, tam sim no koj tuaj yeem thauj koj cov qauv. Txhawm rau thauj cov qauv, nyem rau ntawm 'Cov ntaub ntawv tau txais'. Tam sim no ntawm nplooj ntawv Nrhiav cov ntaub ntawv, nkag mus rau lub npe daim ntawv lo, xaiv lub microphone ua lub ntsuas pa, thiab nkag mus rau qhov piv txwv ntev. Nyem rau 'Pib piv txwv', txhawm rau pib ua piv txwv 40 Sec. Hloov chaw yuam koj tus kheej kom hnoos, koj tuaj yeem siv cov hnoos hnoos online ntawm qhov ntev sib txawv. Sau tag nrho 10 txog 12 hnoos hnoos hnoos ntev sib txawv.
Kauj ruam 4:
Tom qab tso cov hnoos hnoos qeev, tam sim no teeb tsa daim ntawv lo rau 'suab nrov' thiab sau lwm 10 mus rau 12 lub suab piv txwv.
Cov qauv no yog rau Kev Kawm Txuj Ci, hauv cov kauj ruam tom ntej, peb yuav sau Cov Ntawv Xeem. Cov ntaub ntawv xeem yuav tsum yog tsawg kawg 30% ntawm cov ntaub ntawv kev qhia, yog li sau 3 qhov piv txwv ntawm 'suab nrov' thiab 4 txog 5 qhov piv txwv ntawm 'hnoos'. Impulse CLI Uploader. Txhawm rau teeb tsa CLI Uploader, ua ntej, rub tawm thiab teeb tsa Node.js ntawm koj lub laptop. Tom qab ntawd qhib qhov hais kom ua sai sai thiab nkag mus rau cov lus txib hauv qab no:
npm nruab -g ntug-impulse-cli
Tam sim no rub tawm cov ntawv teev tseg (Dataset Txuas) thiab rho tawm cov ntawv hauv koj li phiaj xwm phiaj xwm. Qhib qhov hais kom sai thiab taw mus rau cov chaw khaws cia cov ntaub ntawv thiab khiav cov lus txib hauv qab no:
ntug-impulse-uploader --cleanedge-impulse-uploader --category qhia kev kawm/*. json
edge-impulse-uploader --category kev cob qhia kev kawm/*. cbor
ntug-impulse-uploader -category testing testing/*. json edge-impulse-uploader --category testing testing/*. cbor
Kauj Ruam 5: Kev cob qhia Tus Qauv thiab Hloov Kho Txoj Cai
Raws li cov ntaub ntawv tau npaj tiav, tam sim no peb yuav tsim qhov kev xav rau cov ntaub ntawv. Rau qhov ntawd mus rau nplooj ntawv 'Tsim kev xav'.
Tam sim no ntawm nplooj ntawv 'Tsim kev xav', nyem rau ntawm 'Ntxiv qhov ua ntu'. Hauv lub qhov rai tom ntej, xaiv lub Suab (MFCC) thaiv. Tom qab ntawd nyem rau 'Ntxiv kev thaiv kev kawm' thiab xaiv Neural Network (Keras) thaiv. Tom qab ntawv nyem rau 'Save Impulse'.
Hauv cov kauj ruam tom ntej, mus rau nplooj ntawv MFCC thiab tom qab ntawv nyem rau 'Tsim Nta'. Nws yuav tsim MFCC thaiv rau tag nrho peb lub qhov rais ntawm lub suab.
Tom qab ntawd mus rau 'NN Classifier' nplooj ntawv thiab nyem rau ntawm peb lub teev nyob rau sab xis saum toj ntawm 'Neural Network teeb tsa' thiab xaiv 'Hloov mus rau Keras (tus kws tshaj lij) hom'.
Hloov qhov qub nrog cov cai hauv qab no thiab hloov qhov 'Yam tsawg kawg kev ntseeg siab ntsuas' rau '0.70'. Tom qab ntawv nyem rau lub pob 'Pib kawm'. Nws yuav pib qhia koj tus qauv.
ntshuam tensorflow li tffrom tensorflow.keras.models ntshuam Sequential los ntawm tensorflow.keras.layers import Dense, InputLayer, Dropout, Flatten, Reshape, BatchNormalization, Conv2D, MaxPooling2D, AveragePooling2D from tensorflow.keras.optimizers import Adam from tensorflow.keras.optimizers import Adam from tensorflow.keras.opras MaxNorm # qauv architecture qauv = Sequential () model.add (InputLayer (input_shape = (X_train.shape [1],), name = 'x_input')) model.add (Reshape ((int (X_train.shape [1] /) 13), 13, 1), input_shape = (X_train.shape [1],))) model.add (Conv2D (10, kernel_size = 5, ua kom = 'relu', padding = 'tib yam', kernel_constraint = MaxNorm (3))) model.add (AveragePooling2D (pool_size = 2, padding = 'tib yam))) model.add (Conv2D (5, kernel_size = 5, ua kom =' relu ', padding =' zoo ib yam ', kernel_constraint = MaxNorm (3))) model.add (AveragePooling2D (pool_size = 2, padding = 'tib yam))) model.add (Flatten ()) model.add (Dens (chav kawm, ua kom =' softmax ', lub npe =' y_pred ', kernel_constraint = MaxNorm (3))) # qhov no tswj hwm qhov kev kawm paub opt = Adam (lr = 0.005, beta_ 1 = 0.9, beta_2 = 0.999) # cob qhia neural network qauv.compile (poob = 'categorical_crossentropy', optimizer = opt, ntsuas = ['raug']) model.fit (X_train, Y_train, batch_size = 32, epochs = 9, validation_data = (X_test, Y_test), verbose = 2)
Kauj Ruam 6:
Tom qab kev cob qhia tus qauv, nws yuav qhia txog kev qhia ua haujlwm. Rau kuv, qhov raug yog 96.5% thiab poob yog 0.10 uas yog qhov zoo rau kev mus.
Tam sim no raws li peb tus qauv ntsuas hnoos tau npaj txhij, peb yuav xa cov qauv no ua Arduino lub tsev qiv ntawv. Ua ntej rub tawm tus qauv ua lub tsev qiv ntawv, koj tuaj yeem sim qhov ua tau zoo los ntawm kev mus rau nplooj ntawv 'Live Classification'. Mus rau nplooj ntawv 'Deployment' thiab xaiv 'Arduino Library'. Tam sim no nqes mus thiab nyem rau 'Tsim' kom pib txheej txheem. Qhov no yuav tsim lub tsev qiv ntawv Arduino rau koj txoj haujlwm.
Tam sim no ntxiv cov tsev qiv ntawv hauv koj Arduino IDE. Txog qhov ntawd qhib Arduino IDE thiab tom qab ntawd nyem rau Sketch> suav nrog Tsev qiv ntawv> Ntxiv. ZIP lub tsev qiv ntawv. Tom qab ntawd, thauj tus piv txwv los ntawm kev mus rau File> Piv txwv> Koj lub npe project - Edge Impulse> nano_ble33_sense_microphone. Peb yuav hloov qee qhov hauv cov cai kom peb tuaj yeem ua lub suab ceeb toom thaum Arduino pom hnoos. Txog qhov ntawd, lub suab nrov cuam tshuam nrog Arduino thiab thaum twg los xij nws pom hnoos, LED yuav ntsais peb zaug. Cov kev hloov pauv tau ua nyob rau hauv lub voj void () ua haujlwm qhov twg nws tau luam tawm lub suab nrov thiab hnoos qhov tseem ceeb. Hauv txoj cai qub, nws tau luam tawm ob daim ntawv lo thiab lawv qhov txiaj ntsig ua ke. rau (size_t ix = 0; ix <EI_CLASSIFIER_LABEL_COUNT; ix ++) {ei_printf (" %s: %.5f / n", result.classification [ix].label, result.classification [ix].value); } Peb yuav khaws ob qho tseem ceeb ntawm lub suab nrov thiab hnoos hauv qhov sib txawv sib txawv thiab sib piv cov suab nrov. Yog tias lub suab nrov qis dua 0.50 uas txhais tau tias tus nqi hnoos ntau dua 0.50 thiab nws yuav ua suab nrov. Hloov qhov qub rau lub voj () chaws nrog qhov no: rau (size_t ix = 1; ix <EI_CLASSIFIER_LABEL_COUNT; ix ++) {Serial.print (result.classification [ix].value); ntab cov ntaub ntawv = result.classification [ix].value; yog tias (Cov ntaub ntawv <0.50) {Serial.print ("Pom hnoos"); tswb (); }} Tom qab ua qhov hloov pauv, xa cov cai rau hauv koj Arduino. Qhib tus lej saib ntawm 115200 baud.
Yog li qhov no yog yuav ua li cas lub tshuab ntsuas hnoos tuaj yeem tsim tau, nws tsis yog txoj hauv kev zoo siv los nrhiav ib qho kev tiv thaiv COVID19 tab sis nws tuaj yeem ua haujlwm zoo hauv qee qhov chaw muaj neeg coob.
Kauj ruam 7: Code
Thov nrhiav cov ntawv txuas nrog, Thiab yog tias koj nyiam nws tsis txhob hnov qab pov npav rau kuv hauv qhov kev sib tw hauv qab no.
Pom zoo:
Zigbee Lub Tsev Ntes Ntes Ntes: 8 Kauj Ruam
Zigbee Bed Presence Detector: Rau qee lub sijhawm tam sim no kuv tau nrhiav txoj hauv kev txhawm rau txheeb xyuas thaum peb nyob hauv txaj. Qhov no rau kev siv cov ntaub ntawv no rau hauv Homeassistant. Nrog cov ntaub ntawv no kuv tuaj yeem ua lub tshuab kom kaw lub teeb thaum tsaus ntuj lossis piv txwv qhib lub tswb nrov hauv kuv li
Cov Hnab Hnab Hnab Tsho Hnab Tsho Chaw Nyob: 11 Kauj Ruam
Cov Hnab Ntim Hnab Hauv Cov Chaw Taws Teeb: Tam sim no ib hnub cov thev naus laus zis tau txav mus rau qhov kev paub ntau ntxiv uas muab rau tus neeg siv txoj hauv kev tshiab los cuam tshuam nrog yam khoom hauv ib puag ncig virtual lossis kev muaj tiag. Nrog thev naus laus zis hnav tau nce zuj zus thiab ntau ntxiv nrog cov xov tooj ntse ntxiv rau
Cov Ntim Ntim Ntim: 8 Kauj Ruam (nrog Duab)
Cov Lus Hais Tias: Hauv Asmeskas ib leeg, cov neeg Amelikas nruab nrab mus txog 7 phaus khib nyiab txhua hnub. Ntau tshaj ib lab tons ntawm cov kaus poom tin tau muab pov tseg txhua xyoo. Kev rov ua dua tshiab yog qhov zoo dua li sau cov chaw pov tseg, tab sis rov siv dua thiab rov ntim dua lwm cov ntim pov tseg yog
Micro: ntsis Ntes Ntes Ntes Ntes: 3 Kauj Ruam
Micro: ntsis Ntes Ntes Ntes Ntes: Qhov no tsuas yog ib qho piv txwv luv luv rau lub suab nrov ntsuas ntsuas raws qhov micro: me ntsis thiab Pimoroni enviro: ntsis.Qhov microphone ntawm enviro: ntsis pom lub suab qib, thiab los ntawm qhov txiaj ntsig txiaj ntsig txoj haujlwm ntawm 5x5 LED matrix tau suav thiab
Hnab Hnab Ntim: Yuav Ua Li Cas Thiaj Li Taws Teeb: 6 Kauj Ruam
Hnab Hnab Ntim: Yuav Ua Li Cas Thiaj Li Taws Teeb: Nyob Zoo Rau Txhua Tus !! Uas yog Cov Lus Qhia ntawm Chip, thiab nws lub hnab ev ntawv Pochet CHIP. CHIP yog dab tsi? CHIP yog lub khoos phis tawj me tshaj Linux raws li tsim los ntawm Next Yam los ntawm Kickstarter phiaj los nqis tes. Saib qhov txuas txhawm rau saib txhua tus yam ntxwv (http://docs.getchip.com/chi