{"id":15555746,"url":"https://github.com/fpaskali/neck-swe-classification","last_synced_at":"2026-03-08T08:33:44.562Z","repository":{"id":178680132,"uuid":"564494105","full_name":"fpaskali/neck-swe-classification","owner":"fpaskali","description":"Python workflow for supervised classification of shear wave elastography images from neck area.","archived":false,"fork":false,"pushed_at":"2025-05-30T08:03:43.000Z","size":5270,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-13T14:59:01.493Z","etag":null,"topics":["biomedical-image-processing","data-science","machine-learning","neck-muscle","neck-pain","python","shear-wave-elastography","ultrasound-imaging"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fpaskali.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-11-10T20:55:29.000Z","updated_at":"2025-06-11T07:47:27.000Z","dependencies_parsed_at":"2023-11-06T08:40:45.136Z","dependency_job_id":"7a1f7524-84b5-4172-97d2-d234f0b55662","html_url":"https://github.com/fpaskali/neck-swe-classification","commit_stats":{"total_commits":28,"total_committers":3,"mean_commits":9.333333333333334,"dds":0.2857142857142857,"last_synced_commit":"9c775849c427979c0331fa97fcfe30ca4adbdf1e"},"previous_names":["fpaskali/neck-swe-classification"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fpaskali/neck-swe-classification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpaskali%2Fneck-swe-classification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpaskali%2Fneck-swe-classification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpaskali%2Fneck-swe-classification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpaskali%2Fneck-swe-classification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fpaskali","download_url":"https://codeload.github.com/fpaskali/neck-swe-classification/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpaskali%2Fneck-swe-classification/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278956324,"owners_count":26075221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["biomedical-image-processing","data-science","machine-learning","neck-muscle","neck-pain","python","shear-wave-elastography","ultrasound-imaging"],"created_at":"2024-10-02T15:10:29.746Z","updated_at":"2025-10-08T13:54:16.918Z","avatar_url":"https://github.com/fpaskali.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Specification of neck muscle dysfunction through digital image analysis using machine learning\n\u003cp align=center\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/fpaskali/neck-swe-classification/main/preview/preview1.png\" width=\"800\" align=\"center\" alt=\"Shear Wave Elastography\"/\u003e\n\u003c/p\u003e\n\nThis is a repository of the python code used in the paper https://www.mdpi.com/2075-4418/13/1/7. All python scripts and notebooks, as well as extracted features needed to reproduce the analysis are included.\n\n## Abstract ##\n\nEveryone has or will have experienced some degree of neck pain. Typically, neck pain is associated with the sensation of tense, tight, or stiff neck muscles. However, it is unclear whether the neck muscles are objectively stiffer with neck pain. The study used 1099 ultrasound elastography images (elastograms) obtained from 38 adult women, 20 with chronic neck pain and 18 asymptomatic. For training machine learning algorithms, 28 numerical characteristics were extracted from both the original and transformed shear wave velocity color-coded images as well from respective image segments. Overall, a total number of 323 distinct features were generated from the data. A supervised binary classification was performed, using six machine-learning algorithms. The random forest algorithm produced the most accurate model to distinguish elastograms of women with chronic neck pain from asymptomatic women with an AUC of 0.898.  When evaluating features that can be used as biomarkers for muscle dysfunction in neck pain, the region of the deepest neck muscles (M. multifidus) provided the most features to support the correct classification of elastograms. By constructing summary images and associated Hotelling’s T² maps, we enabled the visualization of group differences and their statistical confirmation.\n\n## User Manual ##\nFor the analysis Python 3.10 was used.\n\n### Installation of required packages ###\n    pip install -r requirements.txt\n    \n### General recommendations ###\n\n#### Folder structure ####\nThe folder structure could be easily customized within the scripts. The here presented structure is merely a suggestion.\n\nIt is recommended, the scripts to be placed in a directory, together with the following folders:\n* data - directory that contains csv files with data information and data/images contains the raw image data.\n* figures - directory that contains all graphs generated by scripts with matplotlib.\n* tables - directory that contains csv tables generated by scripts.\n\n#### CSV file ####\n\nThe scripts require a csv file that contains imaging following the proposed structure. \n\n* subject - the id of the subject.\n* repeat - the number of the imaging session.\n* group - the pain or control. (e.g. pain = 0, control = 1)\n* task1_E - path to the elastrography image file.\n* task2_Q - path to the quality map file.\n\nThe number of columns is not limited, but additional columns should always be added in pairs of elastography images and quality maps.\n\n| subject | repeat | group | task1_E                   | task1_Q                   | task2_E                   | task2_Q                   |\n|---------|--------|-------|---------------------------|---------------------------|---------------------------|---------------------------|\n| 1       | 1      | 0     | data/images/imageE001.BMP | data/images/imageQ001.BMP | data/images/imageE007.BMP | data/images/imageQ007.BMP | \n| 1       | 2      | 0     | data/images/imageE002.BMP | data/images/imageQ002.BMP | data/images/imageE007.BMP | data/images/imageQ008.BMP | \n| 1       | 3      | 0     | data/images/imageE003.BMP | data/images/imageQ003.BMP | data/images/imageE009.BMP | data/images/imageQ009.BMP | \n| 2       | 1      | 1     | data/images/imageE004.BMP | data/images/imageQ004.BMP | data/images/imageE010.BMP | data/images/imageQ010.BMP | \n| 2       | 2      | 1     | data/images/imageE005.BMP | data/images/imageQ005.BMP | data/images/imageE011.BMP | data/images/imageQ011.BMP | \n| 2       | 3      | 1     | data/images/imageE006.BMP | data/images/imageQ006.BMP | data/images/imageE012.BMP | data/images/imageQ012.BMP | \n\n## Scripts ##\n\n### Summary image and Hotellings T² map generator (summary_image_and_hotellings_t2_map_generator.py)\nThe script generates mean, median, and std summary images, together with Hotelling's T² test map, by analyzing the shear wave elastography images of two groups.\n\nUsage: \n\n    summary_image_and_hotellings_t2_map_generator.py [-h] [-data DATA] [-r] [-tasks TASKS] [-inter]\n\n    Summary image generator\n\n    options:\n      -h, --help    show this help message and exit\n      -data DATA    CSV file with images info.\n      -r            Remove all images with less than 50 percent colored pixels.\n      -tasks TASKS  Read in the tasks from CSV file.\n      -inter        Use intersection of ROI instead of the largest ROI when cropping the images.\n    \n    Example usage:\n      python summary_image_and_hotellings_t2_map_generator.py -data data/dataset.csv -inter\n\n### SWE image feature extractor (swe_image_feature_extractor.py) ###\nThe script extracts features from the shear wave elastography images such as mean, median, number of red pixels etc., from the whole image or/and from horizontal segments.\n\nUsage: \n\n    swe_image_feature_extractor.py [-h] [-csv CSV] [-roi] [-seg] [-remove] [-bottom]\n\n    Feature extraction script.\n\n    options:\n      -h, --help  show this help message and exit\n      -csv CSV    path to dataset csv file.\n      -roi        Extract features of roi.\n      -seg        Segment roi and extract features.\n      -remove     Remove images with less than 50 percent colored pixels.\n      -bottom     Extract features from bottom part only.\n\n    Example usage:\n      python swe_image_feature_extractor.py -csv data/dataset.csv -roi\n\n\n## Notebooks ##\nThe notebooks can be loaded in JupyterLab or Jupyter Notebook.\n\n### Machine Learning with Grid Search (MachineLearningWithGridSearch.ipynb) #### \nEvaluation of six machine learning models with hyper-parameter optimization and nested cross-validation.\n\n### Random Forest Best Features Extraction (RandomForestBestFeatures.ipynb) ####\nExtracting impurity base feature importance from cross-validation of Random Forest Classifier. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffpaskali%2Fneck-swe-classification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffpaskali%2Fneck-swe-classification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffpaskali%2Fneck-swe-classification/lists"}