{"id":16221534,"url":"https://github.com/inevitable-team/tfjs-transfer-learner","last_synced_at":"2026-01-24T18:02:56.965Z","repository":{"id":35144713,"uuid":"212556929","full_name":"inevitable-team/tfjs-transfer-learner","owner":"inevitable-team","description":"Retrain the MobileNet model via transfer learning using TensorFlow.js in NodeJS.","archived":false,"fork":false,"pushed_at":"2026-01-19T11:01:01.000Z","size":383,"stargazers_count":1,"open_issues_count":29,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-19T18:07:03.876Z","etag":null,"topics":["ai","image-classification","machine-learning","ml","mobilenet","npm-module","npm-package","tensorflow","transfer-learning"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@inevitable/tfjs-transfer-learner","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inevitable-team.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-10-03T10:53:12.000Z","updated_at":"2020-04-29T14:04:16.000Z","dependencies_parsed_at":"2026-01-19T13:12:10.062Z","dependency_job_id":null,"html_url":"https://github.com/inevitable-team/tfjs-transfer-learner","commit_stats":{"total_commits":25,"total_committers":2,"mean_commits":12.5,"dds":"0.040000000000000036","last_synced_commit":"fa9671d6b141fff752d266fb4eb1626b25fa6d33"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/inevitable-team/tfjs-transfer-learner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inevitable-team%2Ftfjs-transfer-learner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inevitable-team%2Ftfjs-transfer-learner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inevitable-team%2Ftfjs-transfer-learner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inevitable-team%2Ftfjs-transfer-learner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inevitable-team","download_url":"https://codeload.github.com/inevitable-team/tfjs-transfer-learner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inevitable-team%2Ftfjs-transfer-learner/sbom","scorecard":{"id":487792,"data":{"date":"2025-08-11","repo":{"name":"github.com/inevitable-team/tfjs-transfer-learner","commit":"fa9671d6b141fff752d266fb4eb1626b25fa6d33"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/23 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"22 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-pp7h-53gx-mx7r","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-gp95-ppv5-3jc5","Warn: Project is vulnerable to: GHSA-54xq-cgqr-rpm3","Warn: Project is vulnerable to: GHSA-wpg7-2c88-r8xv","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-pq67-2wwv-3xjx","Warn: Project is vulnerable to: GHSA-8cj5-5rvv-wf4v"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T18:14:39.264Z","repository_id":35144713,"created_at":"2025-08-19T18:14:39.264Z","updated_at":"2025-08-19T18:14:39.264Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28733337,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T17:51:25.893Z","status":"ssl_error","status_checked_at":"2026-01-24T17:50:48.377Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","image-classification","machine-learning","ml","mobilenet","npm-module","npm-package","tensorflow","transfer-learning"],"created_at":"2024-10-10T12:08:34.980Z","updated_at":"2026-01-24T18:02:56.950Z","avatar_url":"https://github.com/inevitable-team.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TensorFlowJS Transfer Learner\n\nRetrain the MobileNet model via transfer learning using TensorFlow.js in NodeJS.\n\nUsing the popular MobileNet model as a feature extractor, this package allows a user to target a source folder of images, then produce a model to be trained or tested.\n\n## Example Usages\n\n### Basic\n\nTo use this package and run it on the test data provided, the only code that needs to be wrote is:\n\n```js\n    let config = {};\n    let transferLearnerTester: new transferLearner(config);\n    await transferLearnerTester.setup();\n    await transferLearnerTester.train();\n    await transferLearnerTester.evaluate();\n    console.table(transferLearnerTester.prettyConfusionMatrix());\n    console.log(\"Accuracy: \", transferLearnerTester.accuracy() + \"%\");\n```\n\nWhich will then display a result of:\n\n```\n    ┌────────────────┬───────────────────┬────────────────────┬──────────────────┐\n    │    (index)     │ \"blue\" Prediction │ \"green\" Prediction │ \"red\" Prediction │\n    ├────────────────┼───────────────────┼────────────────────┼──────────────────┤\n    │ \"blue\" Actual  │         1         │         0          │        0         │\n    │ \"green\" Actual │         1         │         2          │        0         │\n    │  \"red\" Actual  │         0         │         0          │        3         │\n    └────────────────┴───────────────────┴────────────────────┴──────────────────┘\n    Accuracy:  85.71%\n```\n\n### Use Model to Predict a new Image \n\nUsing the trained model from above, the following code can be added to see the prediction of a given image.\n\n```js\n    let onePrediction = await transferLearnerTester.predictOne(`${__dirname}/example_dataset/green/1.png`);\n    console.log(\"Predict One Prediction: \", onePrediction);\n```\n\nWhich will then log the following result:\n\n```\n    Predict One Prediction:  green\n```\n\n## Source Folder Structure\n\nIn the `imagesUrl` parameter you specify for the source folder, there are two acceptable structure, one where you can manually split the training and testing data, then another where it is randomly determined by the `split` parameter.\n\n### Manual Split \n\n```\nexample_dataset\n+-- training\n|   +-- blue\n|   |   +-- image_x.jpeg\n|   |   +-- image_z.png\n|   |   +-- image_l.png\n|   +-- green\n|   |   +-- image_q.png\n|   |   +-- image_a.jpg\n|   |   +-- image_d.jpeg\n+-- testing\n|   +-- blue\n|   |   +-- image_er.png\n|   |   +-- image_do.jpg\n|   |   +-- image_b.jpg\n|   +-- green\n|   |   +-- ima_0.jpeg\n|   |   +-- imatg.jpg\n```\n\n### Auto Split \n\n```\nexample_dataset\n+-- blue\n|   +-- image_x.jpeg\n|   +-- image_z.png\n|   +-- image_do.jpg\n|   +-- image_b.jpg\n+-- green\n|   +-- image_q.png\n|   +-- image_a.jpg\n|   +-- image_d.jpeg\n```\n\n## Parameters\n\nThe `imagesUrl` has been mentioned to specify the source folder, but below are all of the possible parameters that can be used when instantiating a new transferLearner Object.\n\n```js\n    let config: {\n        onlyTesting: false, // Optional: Boolean, true if you want to test via other means and use the \"predictOne\" function\n        split: 0.75, // Optional: Float, vary the difference in training and testing data, 0.75: 75% of the images will be used for training\n        oldModel: null,  // Optional: tf.model(), Only pass if you do not wish to download and use the model from the oldModelUrl\n        oldModelUrl: 'https://storage.googleapis.com/tfjs-models/tfjs/mobilenet_v1_0.25_224/model.json',  // Optional: URL / String\n        oldModelLayer: 'conv_pw_13_relu',  // Optional: String, which layer of the old model to be used as the feature extractor\n        oldModelImageSize: 224,  // Optional: Number, specifiy the input width/height of the old model\n        oldModelImageShape: [this.oldModelImageSize, this.oldModelImageSize, 3],  // Optional, using the input size to get the shape\n        imagesUrl: `${__dirname}/example_dataset`,  // Optional: String, specify the location of where the source folder is of the images\n        lossFunction: 'categoricalCrossentropy',  // Optional: String, loss function for the models training phase\n        optimizer: tf.train.adam(),  // Optional: tf.train / String, optimizer for the models training phase\n        epochs: 5,  // Optional: Number, specify the amount of epoches to be run during the training phase\n        batchSize: 8 // Optional: Number, specify the size of batchs to be run during the training phase\n    }\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finevitable-team%2Ftfjs-transfer-learner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finevitable-team%2Ftfjs-transfer-learner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finevitable-team%2Ftfjs-transfer-learner/lists"}